Problem to solve
How can I delete the latest tags in the GitLab Registry using the cleanup policy settings?
Currently, we build the Docker images like this:
docker build . -t $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA -t $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest –push
This results in a lot of latest tags remaining from branches that have not existed for years.
Steps to reproduce
Build images with this command:
docker build . -t $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA -t $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest –push
Configuration
Provide screenshots from the GitLab UI showing relevant configuration, if applicable.
On self-managed instances, add the relevant configuration settings or changes.
Versions
Please select whether options apply, and add the version information.
- Self-managed
- GitLab.com SaaS
Versions
- GitLab (Web:
/help
or self-managed system information): v17.1.2