Ensure - If does not exist put option
I have a scenario where build of the same docker image can be triggered from many different pipelines. I would like to reduce the time this task will take if the image already exists.
I know that this does not seem to make a lot of sense - if the existing one is not exactly the same as the one that is going to be produced. I am handling this outside, but build if needed option could be also considered for the plugin (it is not as hard if you design the dockerfile with such feature in mind).
Anyways, what I would like to see is if this option is enabled the put command to first check if a docker image at the repo with the tag is already there and simply exit with success.
Hi there!
We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.
The current status is as follows:
- [ ] #135175651 Ensure - If does not exist put option
This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.
I only have one pipeline but I do like this feature. I was looking for something like this.
Would you guys accept a PR for this feature? It's something my company needs for our use-cases as well.
We're going to be doing a gradual transition to concourse and as such we'll have a mix of developers pushing images directly. Our registry, artifactory, doesn't allow the same tag to be pushed multiple times and causes docker push to throw a cryptic error message (manifest invalid: manifest invalid). This feature would prevent the builds from failing if a particular tag was already present on the registry; effectively making the put a no-op.
I'm thinking this should be a new parameter called prevent_overwrite and it will default to false. I'm open to better names for the parameter. I'm also planning to use docker inspect --type=image ${repository}:${tag_name} to check if the image already exists.
If my proposal is approved, is there a longer process that I'll need to follow to get my changes to flow through into concourse proper?
I've since discovered that docker inspect --type=image only checks local tags, so it's not going to work for what I was hoping.