Automate push/pull of docker image artifacts
Description
CI/CD jobs often produce, and then rely on, docker images, just like other artifacts. We should automate the pushing and pulling of these images between jobs. Also, we should expose image artifacts in the web UI (and API?) as peers of file-based artifacts.
Proposal
build:
script:
- docker build -t foo .
artifacts:
image: foo
test:
dependencies: build
script:
- docker run foo make test
deploy:
dependencies: build
script:
- docker tag foo $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
The image artifact may be stored in the built-in registry using some convention; perhaps just mapping foo
to $CI_REGISTRY_IMAGE/foo
(relying on the newly shipped named images feature).
Also, expose a link to the image artifact on commits, pipelines, and elsewhere we link to downloading file-based artifacts. Downloading the image artifact doesn't make as much sense, but we could at least link to the registry page for it.
Links / references
Documentation blurb
(Write the start of the documentation of this feature here, include:
- Why should someone use it; what's the underlying problem.
- What is the solution.
- How does someone use this
During implementation, this can then be copied and used as a starter for the documentation.)