Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic cleanup of old docker images would be nice #116

Open
bickelj opened this issue Jul 15, 2024 · 1 comment
Open

Automatic cleanup of old docker images would be nice #116

bickelj opened this issue Jul 15, 2024 · 1 comment

Comments

@bickelj
Copy link
Collaborator

bickelj commented Jul 15, 2024

In the test system over the weekend, the continuous integration script notified us of a couple failures. It turns out the disk was probably temporarily full. It is easy enough to run docker system prune --all when verifying that containers are up, but a more regular, targeted approach would be better because it is best to have the previous image present in case we need to roll back.

@bickelj
Copy link
Collaborator Author

bickelj commented Aug 23, 2024

A safer command that can leave at least one image assuming we built an image in the past 336 hours:
docker system prune -a --filter "until=336h"

Perhaps even safer:
[[ "$(docker ps | wc -l)" -eq "4" ]] && docker system prune -a --filter "until=336h"

@bickelj bickelj changed the title Automatic disk cleanup would be nice Automatic cleanup of old docker images would be nice Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant