环境
Docker version 1.13.1, build 092cba3
问题描述
$ docker pull nginx 130 ↵
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: http: error connecting to proxy https://proxy.example.com:443/: dial tcp: lookup proxy.example.com: no such host
X\
解决方法
因为在 /etc/systemd/system/docker.service.d/http-proxy.conf
添加了 HTTPS_PROXY
, 导致链接被代理中转了,代理又是无效的链接.
去掉 HTTPS_PROXY
即可.
[Service]
Environment="NO_PROXY=localhost,127.0.0.1,0.0.0.0"
重启docker, sudo systemctl restart docker.service
$ docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
f2aa67a397c4: Downloading [======================> ] 10.32 MB/22.5 MB
3c091c23e29d: Downloading [====================> ] 8.922 MB/22.11 MB
4a99993b8636: Download complete
说明: docker.service.d/http-proxy.conf
文件是手动创建的.docker不会帮你创建, 所以坑还是自己挖的.