2016-01-18 33 views
2

我需要设置公司代理,以便Docker可以从公共注册表下载图片。Docker:设置代理下载图片

$ sudo docker run hello-world 
Unable to find image 'hello-world:latest' locally 
Pulling repository docker.io/library/hello-world 
Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp: lookup index.docker.io: no such host 

我使用的是Ubuntu 12.04机器。我发现this answer,但在Ubuntu 12.04中不存在systemctl。我怎样才能做到这一点?

谢谢。

+1

谷歌结果#4“泊坞窗设置代理”:http://nknu.net/running-docker-behind-a-proxy-on-Ubuntu-14-04/ –

+0

谢谢。它的工作原理。将它发布为答案,我将接受 –

+0

[无法在代理后面下载Docker镜像](https:/ /stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy) –

回答

0

编辑/etc/defaults/docker.io并添加以下行:

export http_proxy='http://user:[email protected]:proxy-port' 

然后重启码头工人守护进程:

sudo service docker.io restart 

Source

2

我收到以下错误试图运行Hello世界货柜

$docker run hello-world 
Unable to find image 'hello-world:latest' locally 
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 34.205.194.204:443: getsockopt: no route to host. 

我想在下面的链接,工作对我来说相对于HTTPS或HTTP配置

https://docs.docker.com/engine/admin/systemd/#httphttps-proxy

1

在CentOS,什么对我的作品是这行添加到/etc/sysconfig/docker步骤:

http_proxy=your_proxy:port 
0

解决方案:

[根@ XX〜]#搬运工拉你好世界 使用默认标签:最新 拉库docker.io/library/hello-world 错误而拉图像:获取https://index.docker.io/v1/repositories/library/hello-world/images:authenticationrequired文件/etc/systemd/system/docker.service.d/https

早些时候,我已经设置泊坞窗代理-proxy.conf

/* [服务] 环境= “HTTPS_PROXY = http://xxx:8080/” */

然后我评论此,和sys重载 #sudo systemctl守护程序重装 #sudo systemctl restart docker

然后我试着拉你好,我知道了。 或 尝试用正确的用户名,PSWD,代理地址...

泊坞窗的某个时候与代理还没有工作:(代理