简体   繁体   中英

Mirroring private docker registry

What is currently the recommended way to mirror a Private Docker Registry?

Mirroring functionality is provided by official docker-registry image but only for the Public Registry. See documentation : "Beware that mirroring only works for the public registry. You can not create a mirror for a private registry."

My use-case: A bigger development team that is working in an office with a limited network. They only pull docker images from registries. Pushing is occasional and handled by Jenkins box hosted in AWS. Most of the images they use resides in our password protected Private Registry (served over https). So it's only natural to mirror/cache the Registry on a machine in a local network. If not for https I would just go for HTTP_PROXY and local squid install.

I'm sure I'm not the only one solving docker dev bandwidth problem. What do you do?

It is now possible to do this with the "proxy" settings in the configuration for a V2 registry. Just put up another registry (on a different server/port from any other private registry you have) and on every docker engine, set the '--registry-mirror' flag to point to it.

Just watch out for accidental pushes - always retag your images to the private registry or a private repository if you wish to keep them private.

Right now, I would recommend using the (new) golang registry ( https://github.com/docker/distribution ) instead of the (v1) python one, and go with the proxy solution (using HTTP_PROXY + a reverse proxy cache - squid, or whatever else pleases your tastes - I would probably use varnish).

Native support for "mirroring" built into the registry itself will come eventually, and later more flexible transports.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM