Some way to clean up / identify contents of /var/lib/docker/overlay

So we had the same issue (using Gitlab + private registry) and found this solution to work.

sudo gitlab-ctl registry-garbage-collect

This command will remove images in the directory
/var/opt/gitlab/gitlab-rails/shared/registry/docker/registry/v2/blobs

We reclaimed our disk space usage from 89% to 17%.

Note: we also remove old unused images (tags) from the Gitlab web ui under project settings > registry > list containers in repo.

Edit: more info to be found here https://github.com/sciapp/gitlab-registry-cleanup

1 Like