Stack updates and deployments often leave older images, and sometimes old volumes behind. In normal operation, that isn’t a problem - occasional manual cleanup using the Quantum Console is more than enough.
If you use apps that start and stop a lot of docker containers (like CI/CD
systems), you might want to consider automatic cleanup, using a
periodically-running container that runs
docker system prune - like
this example implementation.
Many Docker-based CI systems automatically clean up old images after themselves, or have the option to do so. Check the documentation first.
Docker Swarm rollbacks don’t work if the old images got deleted. And even for manual rollbacks, it’s easier if the images stay on the endpoint for a while. So don’t run automatic cleanups if you don’t absolutely need it.