Bo Wang
Bo Wang

Reputation: 519

can docker registry proxy support multiple remoteurl?

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?

Upvotes: 9

Views: 4030

Answers (2)

Burdeman
Burdeman

Reputation: 9

This PR enables this feature: https://github.com/distribution/distribution/pull/3864. But the maintainers need to merge it in. Otherwise you can use the fork.

Upvotes: 0

BMitch
BMitch

Reputation: 264761

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.

Upvotes: 5

Related Questions