分类

链接

2019 年 6 月
 12
3456789
10111213141516
17181920212223
24252627282930

近期文章

热门标签

新人福利,免费薅羊毛

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

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</code>


<strong>方法 二</strong></pre>
On CentOS the configuration file for Docker is at:
<blockquote><code>/etc/sysconfig/docker</code></blockquote>
Adding the below line helped me to get the Docker daemon working behind a proxy server:
<pre><code>HTTP_PROXY="http://&lt;proxy_host&gt;:&lt;proxy_port&gt;"
HTTPS_PROXY="http://&lt;proxy_host&gt;:&lt;proxy_port&gt;"</code>
export <code>HTTP_PROXY</code> <code>HTTPS_PROXY

============ 欢迎各位老板打赏~ ===========

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

发表评论

留言无头像?