-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to keep tags with "keep-tags-like"? #106
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, we’re using registry-cli for automated housekeeping of our docker repository.
To clean old images we daily run this command:
registry-cli -r <URL> -i <image> --keep-tags-like "release" -–delete
The intent is to keep the 10 latest images (default) including any image that has a tag containing “release” in the name, and delete everything else.
However, we think the result is that images with “release” tags will be deleted as well.
We tested this by pushing an image tagged 1.0.6479-4c40a8 to the repo, and added a tag “TestTagJenkins” to it.
When querying the repository we saw the two seperate entries.
Then we ran the following:
registry-cli -r <URL> -i <image> --tags-like "1.0.6479-4c40a8" --keep-tags "TestTagJenkins" --delete-all --dry-run
The output showed that it would keep the image.
Then we ran the following command:
registry-cli -r <URL> -i <image> --tags-like "1.0.6479-4c40a8" --keep-tags-like "TestTagJenkins" --delete-all --dry-run
The output did not give a message that it would keep it, and after removing the –dry-run it indeed removed it.
According to the documentation the “keep-tags”-option overrides the “tags”-option and it does work as intended when we use “--keeps-tags” instead of “--keep-tags-like” and specify a specific release-tag, but our images typically have a version in the name that we cannot predict, like “release-1.10.3” or “release-2.29.13”, so we have to use "--keep-tags-like".
Assuming our test is correct, how can we filter those images and prevent them from being deleted?
The text was updated successfully, but these errors were encountered: