Docker无法连接网络
刚开始使用Docker的时候,安装Docker后,发现Docker无法连接网络,或者是连接不上Docker Hub,后来上网查找,使用了很多方法都不行,后来在Stackoverflow中发现了一种方法,现在贴出来供大家参考。mkdir /etc/systemd/system/docker.service.dNow create a file called /etc/systemd/system/.
·
刚开始使用Docker的时候,安装Docker后,发现Docker无法连接网络,或者是连接不上Docker Hub,后来上网查找,使用了很多方法都不行,后来在Stackoverflow中发现了一种方法,现在贴出来供大家参考。
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://child-prc.intel.com:913/"
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
From <https://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy>
更多推荐
已为社区贡献1条内容
所有评论(0)