can docker registry proxy support multiple remoteurl?

1/29/2017

Current docker registry looks support one remote url in config.yml only like:

proxy:
      remoteurl: https://registry-1.docker.io

So if docker ask some other image like "gcr.io/google_containers/pause-amd64:3.0", it will not go to the mirror registry.

Is it possible to configure multiple remote urls in one docker registry config.yml?

-- Bo Wang
docker
kubernetes

1 Answer

1/29/2017

You need to setup a separate pull-through registry cache for each remote registry you want to proxy. If you were to do a pull on gcr.io/google_containers/pause-amd64:3.0, it will go directly to grc.io. To use the pull-through cache, you need to point to your local cache server instead.

If you didn't limit the server to only proxy a single source, since you are specifying the cache hostname instead of the remote server hostname, you would create the risk of name collisions with the same image from multiple sources. So only proxying a single source is a good thing.

Since the registry is shipped as a container, you can always run multiple instances, one for each upsteam source, on the same host, with either different exposed ports, or placing them behind a reverse proxy that would send traffic to each on depending on the hostname or path in the request. See nginx-proxy and traefik for examples of reverse proxies.

-- BMitch
Source: StackOverflow