registry-cli
registry-cli copied to clipboard
Can't delete a specific tag for an image
I can't seem to delete a specific tag using the command below. Is that supported? I don't need anything fancy like regex. Just need to delete a specific tag.
docker run --rm anoxis/registry-cli -r https://<registry> --no-validate-ssl --dry-run -i customimage --delete --num 0 --tags-like test_v1
Output
Image: customimage
tag like: test_v1
Adding test_v1 to tags list
tag: test_v1
Getting digests for tags to keep:
Getting digest for tag test_v1
Keep digest sha256:56c610b18b4257b2ed0e0e529a1b0f1cca25a1c135ad064af00ea78892ed746d for tag test_v1
@testphreak could you post output for docker run --rm anoxis/registry-cli -r https://<registry> --no-validate-ssl -i customimage
?
@ipavlushin
---------------------------------
Image: customimage
tag: test_v1
tag: 2.1.7-SNAPSHOT
tag: 2.0.1-SNAPSHOT
tag: 2.1.2
tag: 2.1.8-SNAPSHOT
tag: latest
tag: 2.1.4
tag: 2.1.5
@testphreak try to remove --num 0
from command line.
@ipavlushin already did. Didn't help.
Will delete all but 10 last tags
---------------------------------
Image: customimage
tag like: SNAPSHOT
Adding 2.0.1-SNAPSHOT to tags list
Adding 2.1.7-SNAPSHOT to tags list
Adding 2.1.8-SNAPSHOT to tags list
tag: 2.1.8-SNAPSHOT
tag: 2.1.7-SNAPSHOT
tag: 2.0.1-SNAPSHOT
Getting digests for tags to keep:
Getting digest for tag 2.1.8-SNAPSHOT
Keep digest sha256:df54d968889e302f7e0937a0f26866b01f1dc16104f512754a61d59b204cb975 for tag 2.1.8-SNAPSHOT
Getting digest for tag 2.1.7-SNAPSHOT
Keep digest sha256:4fd2b8181025ae16f128d059977cea42f77ef20066d6efd24b707b0209e0d9ae for tag 2.1.7-SNAPSHOT
Getting digest for tag 2.0.1-SNAPSHOT
Keep digest sha256:23a11a924d658c76818345532a16aea3985a55fc86ad5468e531bcea5157904b for tag 2.0.1-SNAPSHOT
@testphreak ok, then if you have less than 10 tags try with --num 1
not 0.
@ipavlushin do I have to specify --num 1
? Can't I delete a single tag of an image from the registry?
Will delete all but 1 last tags
---------------------------------
Image: customimage
tag like: test_v1
Adding test_v1 to tags list
tag: test_v1
Getting digests for tags to keep:
Getting digest for tag test_v1
Keep digest sha256:56c610b18b4257b2ed0e0e529a1b0f1cca25a1c135ad064af00ea78892ed746d for tag test_v1
Is it possible to get a clarification of this? I have the same use-case, and since we're possibly dealing with tags which we absolutely would want to delete I would like to tread lightly when trying to delete snapshot tags.
The --num tag feels unintuitive to me, I wan't to delete a sub-set of tags, so why would I need to specify the number of tags to keep? I'm not really sure how to interpret the above output of the --dry-run. What list is the tag being added to?
Thanks!
I also ran into troubles deleting a single image:tag combination from the registry. This is really confusing - why should this NOT be possible through registry-cli?
Hello,
Is there any tested workaround using registry-cli ?
For my part I've falled back to curl -X DELETE ...
for this. :man_shrugging: