crater icon indicating copy to clipboard operation
crater copied to clipboard

Proactively delete old Docker images and dangling containers

Open pietroalbini opened this issue 4 years ago • 0 comments

Over time the filesystem of a Crater agent fills up with previous Docker images and containers that failed to be cleaned up. Purging those on crater-azure-1 today freed up around 120GB of storage. We should have a cron somewhere (either on the agent code or on a proper cron in the server) that does the equivalent of:

docker ps -a | grep Exited | awk '{print($1)}' | xargs docker rm
docker image prune

For context, containers that failed to be cleaned up exist because of how Rustwide starts containers: docker create + docker start + docker rm. Rustwide is supposed to clean those containers up even if the Rust code panics or the build failed, but apparently sometimes docker rm itself fails.

pietroalbini avatar Apr 14 '21 22:04 pietroalbini