Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete a specific tag for an image #50

Open
testphreak opened this issue Aug 2, 2018 · 9 comments
Open

Can't delete a specific tag for an image #50

testphreak opened this issue Aug 2, 2018 · 9 comments

Comments

@testphreak
Copy link

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
@ipavlushin
Copy link
Collaborator

@testphreak could you post output for docker run --rm anoxis/registry-cli -r https://<registry> --no-validate-ssl -i customimage?

@testphreak
Copy link
Author

@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

@ipavlushin
Copy link
Collaborator

@testphreak try to remove --num 0 from command line.

@testphreak
Copy link
Author

@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

@ipavlushin
Copy link
Collaborator

@testphreak ok, then if you have less than 10 tags try with --num 1 not 0.

@testphreak
Copy link
Author

@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

@niklashaetty
Copy link

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!

@xenuser
Copy link

xenuser commented Nov 23, 2020

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?

@mikafouenski
Copy link

Hello,
Is there any tested workaround using registry-cli ?
For my part I've falled back to curl -X DELETE ... for this. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants