While checking my Docker images through UGOS, I noticed several entries that appear to be duplicates. The green image is currently running, the gray image seems to be an older version, and the red entries are untagged versions left behind after updates. Are the red images safe to remove, and can the older gray image be deleted too? I want to clean things up without affecting the running container or losing an easy rollback option.
2 Answers
The red entries labeled are usually older image versions that lost their tags when a newer image was pulled. That is normal and not necessarily an error. Docker also will not remove an image if a container still references it, so you cannot accidentally delete the image used by a running container.
If your update process does not clean up old images, you can run a cleanup command after updating your compose projects. For example, `docker image prune -f` removes dangling images without prompting. Just be more careful with `docker image prune -a`, since it can remove unreferenced images that you may want for a quick rollback.

So the green image is considered in use, while an old red or gray image would only be removable if no container references it? If Docker refuses the deletion, that means something still depends on it?