分类目录

链接

2019年六月
« 5月   7月 »
 12
3456789
10111213141516
17181920212223
24252627282930

近期文章

热门标签

博主推荐

现在位置:    首页 > Others > 正文
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection
Others 暂无评论 阅读(37)

Cannot download Docker images behind a proxy

方法 一

Here is a link to the official Docker documentation for proxy HTTP:https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

A quick outline:

First, create a systemd drop-in directory for the Docker service:

mkdir /etc/systemd/system/docker.service.d

Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

Flush changes:

$ sudo systemctl daemon-reload

Verify that the configuration has been loaded:

$ sudo systemctl show --property Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

Restart Docker:

$ sudo systemctl restart docker


方法 二

On CentOS the configuration file for Docker is at:

/etc/sysconfig/docker

Adding the below line helped me to get the Docker daemon working behind a proxy server:

HTTP_PROXY="http://<proxy_host>:<proxy_port>"
HTTPS_PROXY="http://<proxy_host>:<proxy_port>"
export HTTP_PROXY HTTPS_PROXY

本文版权归数据库之家所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection | 数据库之家

发表评论

留言无头像?