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

Docker prune old images #81

Open
aaron97neu opened this issue Sep 28, 2020 · 1 comment
Open

Docker prune old images #81

aaron97neu opened this issue Sep 28, 2020 · 1 comment
Labels
discussion Discussion issue about a new feature enhancement New feature or request

Comments

@aaron97neu
Copy link
Member

Every time container-maintainer pulls down a new image, the old one (and all unused volumes, networks, etc) remain and take up space. As development progresses, this will cause space issues in our oldest production devices. A docker system prune should be called regularly to clean this up.

The challenge comes in that we would like to be able to rollback changes quickly if a new docker container does not work properly, so simply calling docker system prune at the end of the container-maintainer script could introduce new issues when a container immediately fails (We would have to redownload the old container). As @abalmos mentioned, only pruning images older than a week should be sufficient

This would likely live in container-maintainer

@aaron97neu aaron97neu added enhancement New feature or request discussion Discussion issue about a new feature labels Sep 28, 2020
@aaron97neu
Copy link
Member Author

Looks like there is an option to filter what prune
Full systemd integration:
https://gist.github.com/pohmelie/272b5c2487df60eb7ef1c9db4936b331

More details
https://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
https://docs.docker.com/engine/reference/commandline/system_prune/#filtering

Prob best to throw this at the end of container-maintainer instead of a separate systemd process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion issue about a new feature enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant