Mirroring private docker registry

一曲冷凌霜 提交于 2019-12-23 12:28:42

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/29900351/mirroring-private-docker-registry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!