I tried deleting images from a private registry
post which the blobs and the manifest of the pushed image gets deleted .
but it leaves behind an empty repository with the tag of the images which it contained .
Steps Followed:
docker push hostname.xxx.yyy.com:1111/hello-world-abc push the image
The push refers to a repository [hostname.xxx.yyy.com:1111/hello-world-abc] (len: 1)
aef768067415: Pushed
82152269d8b3: Pushed
latest: digest: sha256:c7d713292dd6dc833ef6364cc6c821ce9523883bc97cc24bedbc572343644b68 size: 1937 get the digest value of the pushed image
[root@slc01olq docker]# curl -i -X GET hostname.xxx.yyy.com:1111/v2/hello-world-abc/manifests/latest get the blobs associated with the image
HTTP/1.1 200 OK
{
“schemaVersion”: 1,
“name”: “hello-world-abc”,
“tag”: “latest”,
“architecture”: “amd64”,
“fsLayers”: [
{
“blobSum”: “sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4”
},
{
“blobSum”: “sha256:4276590986f6a900029d4afb65b0969777f5ff9f70a00f896ec3b7372072381c”
Problem statement The image is getting deleted , but an empty repository remins and I want to delete this as the above search returns an o/p :: {“name”:“hello-world-abc”,“tags”:[“latest”]} but actually the latest tag has been deleted
I believe if you run garbage collection, docker exec dockerregistry_registry_1 bin/registry garbage-collect /etc/docker/registry/config.yml
the tag will then be removed from the list of available tags and appear like: {"name":"old_repo","tags":null}
I am uncertain how to completely remove the “name” from the registry.
Let me be more clear. I am uncertain how to remove the repository “name” from the registry via the API. You can manually remove the repository from the registry after removing the last manifest by just deleting it on the registry server.
It will no longer appear in the catalog after that, but I don’t recommend just deleting the repository without first removing all the manifests and running garbage collection.
To get a list of manifests that may still be on the registry, you can run:
This will give you a list of all the manifest IDs on your registry that haven’t been cleaned up yet. If you don’t have a script, you would need to use the delete api to remove them one at a time: curl -X DELETE -H "Authorization: Basic abcde12345" https://private.registry/v2/old_repo/manifests/sha256:<manifest_id_here>
Would like to confirm, based on the above replies - the official way to delete the repo from the catalog (AFTER all manifests under it are purged) is to just delete it from disk?
In other words, there is no API call or garbage collection to remove the empty repository entry, it must be deleted manually from disk?
Similar problem. The names stay with null list of tags. Further, nothing is garbage collected. I know that the same repository:tag is pushed nightly, so there should be lots available to garbage collect. (They do not have a second tag, which would prevent garbage collection.)
The size of the registry on disk is growing unmanageably. There really needs to be a better solution for cleaning up the registry space.