Cleaning up docker registry

My company is forced to use artifactory for a lot of ci jobs and now the gitlab docker registry is obsolete. I’ve got the task to clean up the space (about 500g) and now I dont know how to do this “right”. We have over 1k projects so I just cant go into each one and clean it up one by one.
Would it do harm if I just delete the files on the server?


Some doc on container registry and Gitlab API: GitLab Container Registry | GitLab

I have in the past used the API to list ALL of the projects on the server:

This will dump the header and the number of pages that git will produce:
curl --head “

→ 6 Pages → X-Total-Pages: 6

Then dump each of the pages, one at a time:
2036 curl “” >> Projectlist.json
2037 curl “” >> Projectlist.json
2038 curl “” >> Projectlist.json
2039 curl “” >> Projectlist.json
2040 curl “” >> Projectlist.json
2041 curl “” >> Projectlist.json

distill that down to the URL’s for each project
jq . Projectlist.json | grep http_url_to_repo > ProjectListFromAPI.txt

Use VS code find - replace and column select to clean up to:
Just the project names.

Then feed that to something like: