简体   繁体   English

Docker注册表镜像连接到私有不安全注册表

[英]Docker Registry Mirror connected to a private insecure registry

I am having a private registry (JFrog) which is being used within the company. 我有一个正在公司内部使用的私人注册表(JFrog)。 I would like to set up a registry cache for our project that keeps the heavy load off the private registry. 我想为我们的项目设置一个注册表缓存,以免使私人注册表负担沉重。

As the documentation states a registry mirror for private registries is not supported although an answer in Mirroring private docker registry states that now it is supported. 正如文档所述,不支持私有注册表的注册表镜像,尽管“ 镜像私有Docker注册表镜像”中的回答指出现在已支持。

I tried myself with the following setup: 我尝试了以下设置:

[UBUNTU CLIENT] --- [REGISTRY PROXY] --- [PRIVATE REGISTRY] [UBUNTU客户] --- [代理注册] --- [私人注册]

Registry Proxy is reachable at 192.168.178.111:30222 (running in k8s) 注册表代理可访问192.168.178.111:30222(在k8s中运行)

The private registry contains an image with the name myregistry/mypersonalimg:latest 私有注册表包含名称为myregistry / mypersonalimg:latest的映像。

It is kind of working but not the way I'd like it to. 这是一种工作方式,但不是我想要的方式。 If I want to pull the image from the client I have to use the following command 如果要从客户端提取图像,则必须使用以下命令

docker pull 192.168.178.111:30222/mypersonalimg:latest

I would have expected docker pull myregistry/mypersonalimg:latest would work but I guess docker will look then for a registry called myregistry. 我本来希望docker pull myregistry / mypersonalimg:latest可以工作,但是我想docker然后会寻找一个名为myregistry的注册表。

Setting /etc/docker/daemon.json with registry-mirrors on the client would work for your case. 在客户端上使用注册表镜像设置/etc/docker/daemon.json会适合您的情况。 The dockerd on client will attempting the configured mirrors if the pulled image doesn't give repository address. 如果拉出的映像未提供存储库地址,则客户端上的dockerd将尝试配置镜像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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