What is a dangling image and what is an unused image?

An unused image means that it has not been assigned or used in a container. For example, when running docker ps -a – it will list all of your exited and currently running containers. Any images shown being used inside any of containers are a “used image”.

On the other hand, a dangling image just means that you’ve created the new build of the image, but it wasn’t given a new name. So the old images you have becomes the “dangling image”. Those old image are the ones that are untagged and displays “<none>” on its name when you run docker images.

When running docker system prune -a, it will remove both unused and dangling images. Therefore any images being used in a container, whether they have been exited or currently running, will NOT be affected.

Leave a Comment