Controlling/restricting usage of container registry

The container registry on our on-premises GitLab installation grows faster that we like - and looking at it, a major factor in this is the container registry for certain projects. Right now one of our projects has 50 containers in their registry (and a few days ago, I untagged 40+), as each take up a couple of GiB, it quickly becomes a significant amount of space.

I’m pretty sure they would be fine with only having e.g. 25 containers (or perhaps even fewer), but can I point them at some functionality that automatically untags an old container when they upload a new, or some other way of making it easy for them to limit their usage?

(I know that I’ll have to regularly run gitlab-ctl registry-garbage-collect to actually regain the diskspace from untagged containers, but that’s a very minor detail. I could also fairly quickly make a script that just removes the oldest tags from any registry, but I would prefer to let people have some control over it)

2 Likes

Hi - I’m the product manager for the GitLab Package stage, which includes the Container Registry. Unfortunately, we do not currently have a feature that allows you to automatically untag or delete old containers. Although it is something we are looking to add in the future. The below issues will first set limitations on the registry, then allow users to set quotas and finally add logic to automatically act on those policies.




In the meantime, you can run garbage collection to clean up the registry like you mentioned. Please feel free to email me at trizzi@gitlab.com or comment in any of the above issues.

1 Like