snippetdockerMinor
How to prevent that tags will be overwritten in docker private registries?
Viewed 0 times
preventdockerprivatetagswillthathowoverwrittenregistries
Problem
This is a follow-up to this question about preventing tag overwrite in docker hub.
When one pushes a tag to a private docker registry and the current tag exists then it will be overwritten. How to prevent this?
I have considered using a digest and other solutions, but this does not guarantee overwrites as one is still able to tag an image using a certain digest. I really would like to see an error and an exit code of 2.
When one pushes a tag to a private docker registry and the current tag exists then it will be overwritten. How to prevent this?
I have considered using a digest and other solutions, but this does not guarantee overwrites as one is still able to tag an image using a certain digest. I really would like to see an error and an exit code of 2.
Solution
It is possible to prevent the overwrite of tags by listing the existing tags using https://github.com/jessfraz/reg and exit the pipeline if there is a duplicate.
Context
StackExchange DevOps Q#1549, answer score: 3
Revisions (0)
No revisions yet.