I’m working on a build pipeline using docker-in-docker (through a docker:20.10-dind service) that should:
- build a docker image from a base image + plugin files
- run unit and integration tests using that image (requiring a mariadb service, so I’d like to cleanly separate that out into a test phase)
- then publish the image by pushing it to the registry if the tests were successful
During build I tag the image as all of:
- name:latest
- registry/projectid/name:latest
- registry/projectid/name:base-image-version
In the test phase I tell it to use image: name:latest tag (i.e. without remote registry information) as the image for running the job.
I expected it to use the image existing in the local D-in-D service, but it doesn’t, & I get the following error:
ERROR: Job failed (system failure): failed to pull image "name:latest" with specified policies [always]: Error response from daemon: pull access denied for name, repository does not exist or may require 'docker login' (manager.go:205:0s)
Is there any way to change the pull policy only for one pipeline, or even better only for one phase/job in a pipeline?
The only place I could find was config.toml for a whole build runner, which is really not the granularity I am looking for.
If it’s absolutely not possible, I could tag the image as registry/project/name:candidate in build and push it + then pull it again for test.
That would however occasionally leave broken images lying around, and would also be extremely wasteful and make my build much slower, so I’d really prefer not to pull an image that has to already exist in the docker service for the build.