使用私有注册表的Docker Pull / Push不带前缀 [英] Docker pull/push using private registry without prefixing

查看:301
本文介绍了使用私有注册表的Docker Pull / Push不带前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Nexus3泊坞窗组(将dockerhub代理和私有注册表相结合),又名:

We are using Nexus3 docker groups (combining dockerhub proxy and private registry) aka:

docker pull dockerproxy:5002/busybox

尝试从dockerhub中提取(如果它在私有注册表中不存在),将其推送到私有注册表部分。

trying to pull from dockerhub if it does not exist in private registry, push storing in private registry part. Works fine.

但是我该怎么做:

docker pull busybox

转到此注册表,而不必先添加dockerproxy:5002前缀?

go to this registry without having to prefix dockerproxy:5002 first?

环境变量?$ HOME / .docker / config.json?

An environment variable?, $HOME/.docker/config.json? Creative tagging?

谢谢

推荐答案

Docker支持Docker镜像。 io hub https://docs.docker.com/registry/recipes/mirror/

Docker support mirrors of docker.io hub https://docs.docker.com/registry/recipes/mirror/:


编辑 /etc/docker/daemon.json 并添加注册表-mirrors键和值,以使更改持久化。

edit /etc/docker/daemon.json and add the registry-mirrors key and value, to make the change persistent.

{
registry-mirrors:[ https:// dockerproxy:5002]
}

保存文件并重新加载Docker以使更改生效。

Save the file and reload Docker for the change to take effect.

现在泊坞窗从您的关系代理中拉出busybox

这篇关于使用私有注册表的Docker Pull / Push不带前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆