The docker source defines a struct to hold deleted images when running docker image prune
or docker system prune
:
type ImageDeleteResponseItem struct {
// The image ID of an image that was deleted
Deleted string `json:"Deleted,omitempty"`
// The image ID of an image that was untagged
Untagged string `json:"Untagged,omitempty"`
}
Looking at the comments I don't get the difference between the two. Aren't all untagged images also deleted?
It's not necessary that untagging deletes an image. If you have an image tagged with more than one tag. It'll delete the tag and image will be there with the other tag.
docker rmi first-tag
will remove the first-tag
but will still persist the image with second-tag
. It would have been disastrous if it deleted the whole image whenever we tried to remove the tag.
You can see here for more.