通过代理的Docker

通过代理的Docker,docker,proxy,Docker,Proxy,我确实在CLI上设置了一个代理,如下所示: $ export http_proxy="http://10.20.6.67:1209" $ export https_proxy="https://10.20.6.67:1209" $ export no_proxy="localhost,127.0.0.1,0.0.0.0" 我试图从Docker中提取图像,但它返回以下错误: $ docker pull couchdb Using default tag: latest Error respons

我确实在CLI上设置了一个代理,如下所示:

$ export http_proxy="http://10.20.6.67:1209"
$ export https_proxy="https://10.20.6.67:1209"
$ export no_proxy="localhost,127.0.0.1,0.0.0.0"
我试图从Docker中提取图像,但它返回以下错误:

$ docker pull couchdb
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

我按照中的描述解决了它

创建一个名为/etc/systemd/system/docker.service.d/http proxy.conf的文件,该文件添加http\u proxy环境变量:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
刷新更改:

$ sudo systemctl daemon-reload
重新启动Docker:

$ sudo systemctl restart docker

现在
docker pull
工作了

我按照中所述解决了它

创建一个名为/etc/systemd/system/docker.service.d/http proxy.conf的文件,该文件添加http\u proxy环境变量:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
刷新更改:

$ sudo systemctl daemon-reload
重新启动Docker:

$ sudo systemctl restart docker
现在
docker pull
工作了