简体   繁体   English

在虚拟机Docker中,推送到私有注册表在代理下失败

[英]In virtual-machine Docker push to private registry failed under proxy

I want to push a Docker image to a private registry in the local machine. 我想将Docker镜像推送到本地计算机中的私有注册表。

The docker is running in a virtual-machine CentOS 7 and I'm working a in a network under a proxy. docker在虚拟机CentOS 7中运行,我在代理网络中工作。

What I did is to tag my Docker local image "test_bench_image" obtained from building a dockerfile: 我做的是标记从构建dockerfile获得的Docker本地映像“test_bench_image”:

docker tag test_bench_image localhost:5000/test_bench_image

and then I tried to push it: 然后我试着推动它:

 docker push localhost:5000/test_bench_image

What I get is: 我得到的是:

The push refers to a repository [localhost:5000/test_bench_image]
Put http://localhost:5000/v1/repositories/test_bench_image/: dial tcp 127.0.0.1:5000: getsockopt: connection refused

I understood that /etc/sysconfig/docker should include the variable no_proxy to allow pushing to private Docker registry under a proxy. 我知道/ etc / sysconfig / docker应该包含变量no_proxy以允许在代理下推送到私有Docker注册表。 So I included in the file: 所以我在文件中包含:

...
http_proxy="http://myproxy.es:80"
https_proxy="http://myproxy.es:80"
no_proxy="127.0.0.1:5000"

But I get the same error message after reload the daemon and restart the docker service. 但重新加载守护程序并重新启动docker服务后,我收到相同的错误消息。

Any help will be really welcome. 任何帮助都会非常受欢迎。

Note: My original plan was to use the Docker local image in Jenkins. 注意:我原来的计划是在Jenkins中使用Docker本地映像。 But the Docker plugin cannot pull the local image since it is not publicly available. 但Docker插件无法提取本地图像,因为它不公开。 So I tried to create a private registry and force Jenkins to pull it from there. 所以我尝试创建一个私有注册表并强制Jenkins从那里拉出来。

Thanks. 谢谢。

我遇到了类似的问题,我不得不取消注释并在/ etc / sysconfig / docker文件中的INSECURE_REGISTRY ='XX.XXX.XXX.XXX:5000'部分添加我的私有注册表的主机IP。

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

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