Clean up private docker registry


We are running a private docker registry at my business and we are running out of hard drive space because of all the old containers, layers, blobs, etc that have been generated the last couple of years.

I ran this dry-run command to see what all could be removed:

docker exec registry bin/registry garbage-collect --dry-run /etc/docker/registry/config.yml

Then I ran it without the “dry-run” flag, but it just marks blobs for deletion and didn’t actually delete anything. I have set the registry to allow deletion using the following:

docker run -d -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true

If there some other method for deleting old items from docker registry?