An orphaned image is one without a tag and it is also not a parent of a tagged image. We also call these “dangling” images since they are not really connected to an image tree.
You can find all the orphaned images with docker images -f dangling=true
.
To remove these images, use the -q
flag to just list the image id’s and provide the list to docker rmi
like this:
docker rmi $(docker images -f dangling=true -q)
For more information on the filtering flag see: https://docs.docker.com/reference/commandline/cli/#filtering_2