Docker Community Forums

Share and learn in the Docker community.

Docker image downloading from Docker_Hub or from Registry Mirrors?

Hi folks,

Let’s say mirror.gcr.io as ( Registry Mirrors ) was configured for GCP VM. How can I define from which docker image registry (whether Google mirror registry or Docker Hub) does the next image come:
docker pull alpine
?

Thanks.

Registry Mirrors are ment to be used for regional mirrors of dockerhub.
It seems you want to use a private registry (everything except dockerhub is considered private).
Then docker pull mirror.gcr.io/alpine is the way to go. If the repo requires a login, then perform docker login mirror.gcr.io before.

The easiest way to run a registry as a pull through cache is to run the official Registry image. At least, you need to specify proxy.remoteurl within /etc/docker/registry/config.yml as described in the following subsection.

Multiple registry caches can be deployed over the same back-end. A single registry cache ensures that concurrent requests do not pull duplicate data, but this property does not hold true for a registry cache cluster.

@lewish95
I have no goal to configure/run Registry as a pull-through cache, but it is already configured by Google. Here is link how to configure dockerd to use it.

@meyay
I thought for example if I have pre-configured GCP VM docker daemon with:
docker info

 Registry: https://index.docker.io/v1/
 Labels:
  provider=google
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://mirror.gcr.io/

(please note the output which includes Registry Mirrors), then when I do docker pull alpine docker will try to get alpine:latest image at first from Google mirror registry - mirror.gcr.io, and if this image does not exist there will get it from Docker Hub.