Docker pull/push 使用不带前缀的私有注册表
Docker pull/push using private registry without prefixing
我们正在使用 Nexus3 docker 群组(结合 docker 集线器代理和私人注册表)又名:
docker pull dockerproxy:5002/busybox
尝试从 dockerhub 拉取,如果它不存在于私有注册表中,则推送存储在私有注册表部分。工作正常。
但是我要怎么做:
docker pull busybox
无需先添加前缀 dockerproxy:5002 即可转到此注册表?
环境变量?, $HOME/.docker/config.json?广告素材标记?
谢谢
不,注册表地址是图像完整标记的一部分。如果您不指定地址,则假定为 Docker 集线器,并且您无法更改为不同的默认值。
没有办法解决它(除非构建您自己的 Docker 引擎)- 它是 deliberate design decision:
this would lead to a situation where docker pull ubuntu could mean two different things for two different persons/installs, that would very bad for the user. It would lead to a fragmentation of the ecosystem and break the community.
Docker 支持 docker.io hub 的镜像 https://docs.docker.com/registry/recipes/mirror/:
edit /etc/docker/daemon.json
and add the registry-mirrors key and value, to make the change persistent.
{
"registry-mirrors": ["https://dockerproxy:5002"]
}
Save the file and reload Docker for the change to take effect.
现在 docker pull busybox
来自您的 Nexus 代理。
我们正在使用 Nexus3 docker 群组(结合 docker 集线器代理和私人注册表)又名:
docker pull dockerproxy:5002/busybox
尝试从 dockerhub 拉取,如果它不存在于私有注册表中,则推送存储在私有注册表部分。工作正常。
但是我要怎么做:
docker pull busybox
无需先添加前缀 dockerproxy:5002 即可转到此注册表?
环境变量?, $HOME/.docker/config.json?广告素材标记?
谢谢
不,注册表地址是图像完整标记的一部分。如果您不指定地址,则假定为 Docker 集线器,并且您无法更改为不同的默认值。
没有办法解决它(除非构建您自己的 Docker 引擎)- 它是 deliberate design decision:
this would lead to a situation where docker pull ubuntu could mean two different things for two different persons/installs, that would very bad for the user. It would lead to a fragmentation of the ecosystem and break the community.
Docker 支持 docker.io hub 的镜像 https://docs.docker.com/registry/recipes/mirror/:
edit
/etc/docker/daemon.json
and add the registry-mirrors key and value, to make the change persistent.
{ "registry-mirrors": ["https://dockerproxy:5002"] }
Save the file and reload Docker for the change to take effect.
现在 docker pull busybox
来自您的 Nexus 代理。