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

Delete orphan manifests and content

scottcarey opened this issue · comments

I would like to delete all unreferenced manifests -- those without a tag.

90% of my disk space is eaten up by such things, because the continuous build system pushes artifacts to the latest tag (continuous delivery). This means that stale content has no tag at all, and no way to delete it by tag name. The GC feature in the repo is useless as well, as it does not consider such content an orphan.

Oh, I see it uses the REST api, which makes this impossible. Nevermind.

@scottcarey, Why REST api makes it impossible? You could still have additional API for purging unused manifests. I would really like to see this issue resolved, not closed.

@sasavilic Because there is no way to query the REST api to locate manifests without a tag.

The best I could do is to run the gc, and parse the stdout to collect all the manifests, then compare to what manifests tags point to. Alternatively, one can crawl the file system offline.

Its awful.