You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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: