Image files are independent and combined using unionfs magic to create a running container. The images you care about are often tagged with memorable names. You can delete unused images, i.e. Those that do not contribute to any image that interests you. I do it like this in bash:
function docker_rm_unnamed_images { sudo docker rmi $(sudo docker images | grep '^<none>' | awk '{print $3}') }
You can present the docker image as a stack of "layers". Each Dockerfile command adds an extra layer to the image. It is important to understand that each of these commands creates a separate image file. So Dockerfile
FROM foo RUN a RUN b RUN c
will be a stack
image=1 (possibly pulled from the foo registry) image=2 (after applying a to image 1) image=3 (after applying b to image 2) image=4 (after applying c to image 3)
It is likely that the foo image was made up of several other layers, so your final image is a stack of 4 or more images. Each of these image files is located in your docker image registry. Most of them are unnamed because they correspond to the RUN command, for example. Each of the image files 1-4 is probably quite small (if they do not match, for example, the installation yum install p1 .. p100). Together they make up the container file system that you end up executing.
source share