burnettk / delete-docker-registry-image

If you are running a private v2 docker registry, and you are storing your data on disk, running this script from the machine where the data lives will let you fully delete an image or tag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

push the same image which was deleted via this tool,then cannot pull the this image

joey-jihua opened this issue · comments

  1. use the tool delete the tag of an exist images
  2. push the same image
  3. try to pull the image, failed with error"Error: image hello-world not found"

@joey-jihua yes, i was able to replicate what is probably your issue after messing around with a unit test for awhile. i think what's likely going on is that the registry is caching some state in memory about what data it has stored, so when we push a tag, delete it out from under the registry without it knowing using the script, and then repush it, the registry may believe that it already has the layer in question, so it doesn't re-store it. If you delete line 143 from the test, the test fails. so the fix is to make sure your registry is down while you're running the script. thanks for the report. i had never actually seen an issue caused by keeping the registry running when using this script.

@burnettk thanks for the information!