Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Sonatype Nexus和注册表镜像代理docker hub_Docker_Nexus_Docker Registry - Fatal编程技术网

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

使用Sonatype Nexus和注册表镜像代理docker hub,docker,nexus,docker-registry,Docker,Nexus,Docker Registry,类似于,但我使用的是Sonatype Nexus,与之类似,但我也使用一个安全的密码保护存储库 我在Docker守护进程中有这些设置 { "registry-mirrors": [ "https://repo.myprivate.com" ], "insecure-registries": [], "debug": true, "experimental": false

类似于,但我使用的是Sonatype Nexus,与之类似,但我也使用一个安全的密码保护存储库

我在Docker守护进程中有这些设置

{
  "registry-mirrors": [
    "https://repo.myprivate.com"
  ],
  "insecure-registries": [],
  "debug": true,
  "experimental": false
}
然而,当我拉一张像ubuntu这样的图片,查看网络访问时,我发现它并没有击中我的服务器,而是击中了Docker Hub服务器

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

我还希望避免这样做,即更改图像的名称以添加地址

要使用代理进行拉取,我必须执行我想要避免的
docker pull repo.myprivate.com/library/alpine

在进入注册表镜像之前,它似乎首先对官方存储库进行优先级排序


我尝试的另一件事是使用Windows防火墙阻止IP地址,但它也不会返回到我的私有repo。

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

{
  "insecure-registries": ["10.0.2.2:8181"],
  "registry-mirrors": ["http://10.0.2.2:8181"]
}

愚蠢的问题:在更改daemon.json后是否重新启动了守护进程?是的。我看到它击中它的一些最初的东西,但不到一秒钟,然后开始从DockerHub下载。我的东西是一个安全的注册表。仍然投票,因为它是有效的。