Docker在service和systemctl管理下,Proxy的设置都是不一样的。
service: 需要在 /etc/default/docker中添加
export http_proxy="http://web-proxy.corp.xxxxxx.com:8080/"
export https_proxy="https://web-proxy.corp.xxxxxx.com:8080/"
export no_proxy=localhost,127.0.0.1
添加之后,重新启动docker service, service docker restart
systemctl: 需要在/etc/systemd/system/docker.service.d/http-proxy.conf中添加
[Service]
Environment="HTTP_PROXY=http://web-proxy.corp.xxxxxx.com:" "HTTPS_PROXY=http://web-proxy.corp.xxxxxx.com:" "NO_PROXY=localhost,127.0.0.1"
完成之后执行一下命令
systemctl daemon-reload
systemctl restart docker
上面主要是docker proxy的设置。
网友评论