参考资料:为docker配置HTTP代理服务器

一、注释掉namesserver的配置

[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

二、 代理配置

mkdir -p /etc/systemd/system/docker.service.d
vi /etc/systemd/system/docker.service.d/http-proxy.conf

具体配置内容

[Service]
Environment="HTTP_PROXY=http://xx.xx.xx.xx:80/

三、重启docker

systemctl daemon-reload
systemctl restart docker

四、查看配置结果

systemctl show --property=Environment docker

如果出现如下输出则配置成功

Environment=HTTP_PROXY=http://x.xx.xx.xx:80/

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2021-12-24
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案