Open jamesward opened 4 years ago
This should be an easy thing to fix, but then, it complicates the command we print out a little bit.
Should be as easy as exec'ing into git rev-parse --short HEAD
and trimming output, then passing it to:
image := fmt.Sprintf("gcr.io/%s/%s", project, serviceName)
Feel free to implement if you'd like.
Would we have to also do a push for latest
?
Would we have to also do a push for
latest
?
Not if we use it?
Sorry, I'm not very familiar with how this all works. If we want to tag an image with the short sha and make it so users can pull the latest
without specifying a tag, does that mean we have to push both the short sha tag and the latest
tag?
Yeah, but I'm not exactly sure users pulling images after deploying is a common journey. We'd tag the image twice and push twice (one of them would be a soft-push just creating the tag).
Given we have tools like pack & Jib involved, we might not be able to tag multiple times as efficiently as docker.
There are times where I pull the image for local testing and having latest
for that is helpful. But you are right that this does add some complications when something else does the push. Right now it's just Jib that does it's own push. I wonder if we should actually just turn that off for the sake of simplifying things.
If someone wants to pull images I'm not sure why they can't pull with the :tag ?
They definitely can, it's just a bit more cumbersome.
It'd be cool to put the git commit sha in the container image tag.