Easily re-tag images without pulling first
Summary
With the new container registry, we hope people will use it to store intermediate images during CI. One common use-case is to test an image, and then once it passes, tag the image as latest
. If this is done in a separate deploy
stage, however, the runner will (usually) be missing the current image and thus have to docker pull
before docker tag
and finally docker push
. The registry supports adding a tag directly to an already stored image, but the docker CLI does not support this. We should somehow make this available to CI users so they can re-tag an image without having to pull first.
Options
There are a few different ways we could do this:
- Add to GitLab CLI (but since we don't offer one ourselves, this implies adopting some third-party CLI)
- Patch Docker CLI and send upstream merge request
- Document a
curl
script to use existing registry API - Add a plugin that does it.