Generic image registry support for dependency proxy
Release notes
The gitlab dependency proxy works well for speeding up docker image fetches from docker hub. However, there are many image registries that are not docker hub that would benefit from proxying the images in the same way. Up until now, the dependency proxy did not have that support.
Problem to solve
CI build times can really slow down development. Optimizing those in every way possible can bring significant gains to a development process. If part of the build process is to pull docker images from repositories that are not github, this can introduce significant delays in repeated builds, as each build needs to pull those images from the remote registries. This is why the dependency proxy was created, and for docker hub it works well. However, it is not possible to use it for other registries.
A project I'm working on relies on nearly ten different images from registries that are not docker hub. One build takes 35 minutes. One of the main reasons it takes so long is that these remote registries are pulling images across the Atlantic ocean on every build. Its quite frustrating to iterate on silly bugs when the build takes so long.
The dependency proxy should allow pulling from any image registry, not just docker hub.
Intended users
Developers
- Delaney (Development Team Lead)
- Presley (Product Designer)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Simone (Software Engineer in Test)
- Allison (Application Ops) -->
User experience goal
A developer should be able to use the dependency proxy to pull any image from any registry, not just docker hub, and have it cached by the dependency proxy. It should just happen automatically, without having to configure everything manually.
Proposal
I would suggest pre-pending a typical image: <registry.url>/path/to/image:latest
entry with a gitlab CI variable that tells the dependency proxy to cache the results of that image pull, or use a cached one, if it exists.
For example image ${CI_DEPENDENCY_PROXY_CACHE}:<registry.url>/path/to/image:latest
Permissions and Security
The permissions should be the same as the existing dependency proxy.