5 ms·
> The first thing docker does is it checks its local registry and tries to find a match for the base image the docker build is requesting. If a matching image i
by adrianmsmith 6y ago
> The first thing docker does is it checks its local registry and tries to find a match for the base image the docker build is requesting. If a matching image is located in the local registry, it uses that one in lieu of downloading the image.
While I agree that this is the way it's supposed to work, I have unfortunately worked at companies with "stateless" build/CI servers that download the Docker image each build.
- umvi 6y agoWell, this policy change will force them to be more efficient, and it's a net win for everyone
- Pet_Ant 6y ago> While I agree that this is the way it's supposed to work, I have unfortunately worked at companies with "stateless" build/CI servers that download the Docker image each build. Couldn't they remain stateless but be redirected through a caching proxy? Memoization is not contrary to statelessness.
- jopsen 6y agoSure, now they have to build a proxy...
- hinkley 6y agoArtifactory is less bad than most of the tools I have to use all day.
- falcolas 6y agoArtifactory is the very definition of expensive (even at an enterprise scale) when it comes to docker images though.
- hinkley 6y agoCan you tell me more? How expensive are we talking? Working for the same sized companies for a while has apparently dulled my senses. At a certain size, the capital that matters is the political capital it takes to get a vendor agreement in place to begin with. The monthly costs of the system are something you only feel through pushback on how big the repo gets, or the rate of traffic (experiencing the latter now with a browser testing SaaS)
- eblanshey 6y agoSuper easy to run a docker cache proxy: docker run -d -p 6000:5000 \ -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io \ --restart always \ --name registry registry:2 That's it. Now fetch docker images from the IP that command is running on. Taken from gitlab: https://docs.gitlab.com/runner/install/registry_and_cache_servers.html https://docs.gitlab.com/runner/install/registry_and_cache_se...
- kortex 6y agoI think this addition to docker/config.json should do the trick to make it hit the proxy? https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon https://docs.docker.com/registry/recipes/mirror/#configure-t...
- terom 6y agoIs that going to actually help with the manifest-based rate limits? It sounds like it only caches the layers, the manifest metadata for a tag is not cached. https://docs.docker.com/registry/recipes/mirror/#what-if-the-content-changes-on-the-hub https://docs.docker.com/registry/recipes/mirror/#what-if-the... > When a pull is attempted with a tag, the Registry checks the remote to ensure if it has the latest version of the requested content. Otherwise, it fetches and caches the latest content.