GitLab Container Registry
Cleanup Policies
All projects on GitLab SaaS have 10 GB of free storage. When you reach the limit, your project will be set to read-only until you free up some space or buy more storage. Docker images typically take up a lot of disk space with time. If you don't clean up old images, you may run out of disk space.
Cleanup policies, in this context, are used to automatically delete old Docker images from the registry. This is a useful feature that you can use to avoid finding yourself in such a situation. Go to your project's Settings -> Packages & Registries -> Set cleanup rules. To activate this feature, you need to enable the cleanup policy and set the number of tags to keep, the number of days before expiring a tag or both.
You can use regex to match the tags you want to keep or remove. Here are some examples:
- All tags that have the
main,master, orreleasein their name:.*(main|master|release).*
Cloud Native CI/CD with GitLab
From Commit to Production ReadyEnroll now to unlock all content and receive all future updates for free.
