1

Since v2.4.0 a garbage collector command is included within the registry binary. I read about how it works in the official documentation.

To use the garbage-collection:

bin/registry garbage-collect [--dry-run] /path/to/config.yml

I see the config in /etc/docker/registry/config.yml When I just perform a dry-run I see a lot of blobs marked and at the end the blobs which would have been deleted without dry-run. But I don't see how I can easily link this blobs to images? Which images will be deleted and am I able to tell which image should be deleted or do I need to use another command and after that I have to run the gc?)

Can someone maybe provide an example in which case an image/blob will be deleted? Thanks

1 Answer 1

0

From your referenced documentation:

In the context of the Docker registry, garbage collection is the process of removing blobs from the filesystem which are no longer referenced by a manifest. Blobs can include both layers and manifests.

Manifests are groups of blobs (layers) used to represent an image tag. The only blobs deleted no longer reference any image. So to answer your question, if GC is working correctly, no one should be able to give an example of this deleting an image, but every useful GC should delete blobs, including your own.

3
  • So if I'm able to delete a manifest and than run the GC than everything will be gone in a proper way?
    – DenCowboy
    Aug 23, 2016 at 5:50
  • I checked it and deleted manually a tag + right revision of an image and ran the gc and it worked and it was clean. But is there already a way to delete a manifest based on a tag?
    – DenCowboy
    Aug 23, 2016 at 9:43
  • Last time I looked, I didn't see a way to delete a tag from the registry server itself without using direct API's. So what this is cleaning is anything you pushed with the same tag name but different layers.
    – BMitch
    Aug 23, 2016 at 13:12

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.