September 24, 2022
Dangling Docker images are untagged and unused layers that exist on your host’s filesystem. You might not be aware of their presence and they’re usually unwanted garbage. In this article you’ll learn how dangling images arise and what you can do to clean them up. It’s a good idea to periodically inspect how many dangling…

Dangling Docker images are untagged and unused layers that exist on your host’s filesystem. You might not be aware of their presence and they’re usually unwanted garbage.

In this article you’ll learn how dangling images arise and what you can do to clean them up. It’s a good idea to periodically inspect how many dangling images you have so you can avoid wasting your disk’s capacity.

What Is a Dangling Image?

A dangling image is simply an unused image that’s got no name and tag. You can easily spot dangling images when you run the docker images command because they show up as :.

In this example, the first image in the list is a dangling image:

$ docker images 509bc96b727d 2 months ago 55.3MB mysql 5.7 f26e21ddd20d 4 months ago 450MB gcr.io/k8s-minikube/kicbase v0.0.30 1312ccd2422d 6 months ago 1.14GB hello-world latest feb5d9fea6a5 11 months ago 13.3kB

The image is untagged but still lingering on your system. In this case 55.3 MB of disk space is being consumed.

You can verify the image is dangling and not just unused by checking whether any container references it:

$ docker ps -a…

Read Full Article Source

Leave a Reply

Your email address will not be published.