Auto DevOps: when Dockerfile present, tag the freshly-built Docker image as "latest" on success
As per https://docs.gitlab.com/ce/topics/autodevops/index.html#auto-build:
Either way, the resulting Docker image is automatically pushed to the Container Registry and tagged with the commit SHA.
An option, configurable via a variable, to also tag the image as latest
would be great. docker tag image:sha1 image:latest
should happen at a later point, e.g. somewhere after the test
stage passes.
My use case: I have a small Dockerfile project. The output image is a helper image another GitLab CI build uses to run a build using image: thatimage
. I don't want to hardcode image: thatimage:sha1
in my project everytime a new version of my helper image is released. Just like people use image: ubuntu:16.04
to get the latest version of 16.04.
General use case: tagging the latest working image as latest
is very convenient, especially for development/debugging. All it takes is docker pull thatimage
to get started - compared to docker pull thatimage:sha1
.
(P.S. I understand I can customize Auto DevOps by editing the Auto DevOps template... but it's super inconvenient - I'd have to keep track of upstream Auto-DevOps.yaml and merge changes/features to project's .gitlab-ci.yaml)