參考資料:爲docker配置HTTP代理服務器html
1、註釋掉namesserver的配置docker
[root@nvwa ~]# cat /etc/resolv.conf # Generated by NetworkManager search apa.gad.schneider-electric.com nameserver xx.xx.xx.xx nameserver xx.xx.xx.xx
改成:服務器
[root@nvwa ~]# cat /etc/resolv.conf # Generated by NetworkManager #search apa.gad.schneider-electric.com #nameserver xx.xx.xx.xx #nameserver xx.xx.xx.xx
2、 代理配置ide
mkdir -p /etc/systemd/system/docker.service.d vi /etc/systemd/system/docker.service.d/http-proxy.conf
具體配置內容post
[Service] Environment="HTTP_PROXY=http://xx.xx.xx.xx:80/
3、重啓dockerurl
systemctl daemon-reload
systemctl restart docker
4、查看配置結果spa
systemctl show --property=Environment docker
若是出現以下輸出則配置成功代理
Environment=HTTP_PROXY=http://x.xx.xx.xx:80/