Allow using old docker image if pull fails during CI
Description
Docker had some DNS-related issues recently, causing some requests to lookup registry images to fail. As a result, some CI jobs using a docker image failed to run because the image could not be retrieved, even if an older version of the image was present on disk.
An example log:
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on my.ci (b47439b0)
Using Docker executor with image adduc/alpine-php:71-build ...
Using docker image sha256:7fea78f3ff5038c659e7aea73ae151fdc412670537eaeeced7abedeb9eb25534 for predefined container...
Pulling docker image adduc/alpine-php:71-build ...
ERROR: Preparation failed: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 8.8.8.8:53: no such host
Will be retried in 3s ...
Using Docker executor with image adduc/alpine-php:71-build ...
Using docker image sha256:7fea78f3ff5038c659e7aea73ae151fdc412670537eaeeced7abedeb9eb25534 for predefined container...
Pulling docker image adduc/alpine-php:71-build ...
ERROR: Preparation failed: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 8.8.8.8:53: no such host
Will be retried in 3s ...
Using Docker executor with image adduc/alpine-php:71-build ...
Using docker image sha256:7fea78f3ff5038c659e7aea73ae151fdc412670537eaeeced7abedeb9eb25534 for predefined container...
Pulling docker image adduc/alpine-php:71-build ...
ERROR: Preparation failed: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 8.8.8.8:53: no such host
Will be retried in 3s ...
ERROR: Job failed (system failure): Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 8.8.8.8:53: no such host
Proposal
When docker fails to pull the image defined for a job, but a version of the image exists on disk, GitLab CI should fallback to the old image. This would allow jobs to execute during periods of Docker Hub outages.
Overview
What is it? Why should someone use this feature? What is the underlying (business) problem? How do you use this feature?
Use cases
This is for organizations and users that have not migrated to GitLab's built-in Docker registry, but still rely on Docker Hub for image hosting.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml