mirror of https://github.com/docker/cli.git
Prune digest references when deleting by tag
When pulling an image with content trust enabled, two references are created: a digest reference and a tag reference. Deleting by tag wouldn't actually remove the image, because the digest reference keeps it alive. This change modifies the rmi logic so that digest references don't keep an image alive. If the last tag referencing a given image is deleted, any digest references to it will be removed as well, so the image can actually get deleted. This fixes the usability problem with deletions when content trust is in use, so something like "docker pull busybox; docker rmi busybox" will work as expected. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
parent
66cb79eb98
commit
442cbbfac1
|
@ -19,8 +19,9 @@ parent = "smn_cli"
|
||||||
--no-prune Do not delete untagged parents
|
--no-prune Do not delete untagged parents
|
||||||
|
|
||||||
You can remove an image using its short or long ID, its tag, or its digest. If
|
You can remove an image using its short or long ID, its tag, or its digest. If
|
||||||
an image has one or more tag or digest reference, you must remove all of them
|
an image has one or more tag referencing it, you must remove all of them before
|
||||||
before the image is removed.
|
the image is removed. Digest references are removed automatically when an image
|
||||||
|
is removed by tag.
|
||||||
|
|
||||||
$ docker images
|
$ docker images
|
||||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||||
|
|
Loading…
Reference in New Issue