Can a Gitlab Runner Job have a backup Image if the base image can’t be pulled?
Describe your question in as much detail as possible:
I’d like the gitlab-ci-job to have a potentiall fall-back image if it can’t pull the normal image that it runs.
So say the gitlab-ci-job tries to start and can’t pull the docker exectuor image from a specific registry and receives this error “ERROR: Preparation failed: failed to pull image”, is there a way to set the Runner to check a different registry to pull the same image?
- Add the CI configuration from
.gitlab-ci.yml
and other configuration if relevant (e.g. docker-compose.yml)
Could there be something like this?
job1:
stage: .pre
image: $IMAGE
# Is this possible? Maybe it needs to be a feature request?
# if the job can't pull the image above, it can try to pull this "backup_image"
#backup_image: $BACKUP_RUNNER_IMAGE
Or maybe on retry, use a different image or set a different variable for the image to be used?