It's better to keep an image that was created a long time ago but used every day rather than an image that was created last week and never used since.ĭocuum is meant to be run continuously like a daemon or server, rather than as a one-off command like a cron job. That means even if you frequently use an image (e.g., to create containers or build other images), the built-in Docker command will eventually delete it, which is undesirable (especially if it takes a long time to build/pull). The built-in Docker command will delete the images with the oldest creation date, whereas Docuum will delete the images with the oldest last-use date. The key difference is in how they decide what images to delete. You might wonder what the point of Docuum is, since Docker has a built-in command for cleaning up old images: docker image prune -filter until=….
You tell it the maximum amount of space you want to use for storing Docker images (e.g., 10 GB), and it it deletes images as needed to fit in that space.
I run it on any machine that builds Docker images, such as continuous integration (CI) workers or my laptop. Hey folks, this might be a little niche, but in case it's helpful: I wrote a small program called Docuum (like 'Docker' + 'Vacuum') that cleans up old Docker images to prevent your hard disk from filling up.