When you pull an image with Docker Content Trust enabled, the client sends the "pull by digest" request to the daemon. When the image is pulled by the digest, the daemon will re-tag the image with the digest. It is Docker Content Trust that requires the pulling of the digest as a part of the verification process. Hence the double entries in
docker images output.
If you used
docker pull with Docker Content Trust enabled, you must use the digest to remove the images, rather than the image's tag.
1. Obtain a list of Docker images.
$ docker images ... skipped... 1 00f2bf224679 9 months ago 213.9 MB dev.example.com/xyz/linux6 1.0 8074000920cf 11 months ago 151.5 MB dev.example.com/xyz/linux6 <none> 80009c0920cf 11 months ago 151.5 MB
2. Trying to remove one of those images using the tag results in an error.
$ docker rmi dev.example.com/xyz/linux6 Error response from daemon: could not find image: no such id: dev.example.com/xyz/linux6 Error: failed to remove images: [dev.example.com/xyz/linux6]
To remove images by digest instead of tags:
- Get the digest of the image:
docker images --
- Then use the digest to remove the image: