使用注册表镜像使用 Sonatype Nexus 代理 docker hub

Arc*_*ano 5 nexus docker docker-registry

类似于带有镜像的 Docker 私有注册表,但我使用的是 Sonatype Nexus,它类似于Nexus 注册表镜像 docker hub 不起作用,但我也使用安全密码保护的存储库

我为 Docker 守护进程设置了这些设置。

{
  "registry-mirrors": [
    "https://repo.myprivate.com"
  ],
  "insecure-registries": [],
  "debug": true,
  "experimental": false
}
Run Code Online (Sandbox Code Playgroud)

但是,当我拉取图像ubuntu并查看网络访问时,我发现它没有访问我的服务器,而是访问了 Docker Hub 服务器。

我猜这是因为我没有为镜像设置身份验证,但我不知道要使用的设置。

我还想避免使用 Nexus 3 进行代理私有 docker 注册表,它会更改图像的名称以添加地址。

要使用代理拉取,我必须做docker pull repo.myprivate.com/library/alpine我想避免的事情。

看起来它首先优先考虑官方存储库,然后再访问注册表镜像。

我尝试的另一件事是使用 Windows 防火墙阻止 IP 地址,但它也不会回退到我的私人存储库。

Mag*_*ode 2

就我而言,注册表是 HTTP(只是一个开发测试),因此我也需要将其添加到不安全的注册表中:

{
  "insecure-registries": ["10.0.2.2:8181"],
  "registry-mirrors": ["http://10.0.2.2:8181"]
}
Run Code Online (Sandbox Code Playgroud)