squid代理docker

http://www.dockone.io/article/1380
https://www.cnblogs.com/lixiaolun/p/7449017.html

为docker设置代理

创建目录

创建文件/etc/systemd/system/docker.service.d/http-proxy.conf,内容如下:


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

[Service]
Environment="HTTP_PROXY=http://pill:pill@node2:3128/"
[root@host-10-1-1-71 harbor]# source /etc/profile


重启docker
systemctl daemon-reload
systemctl restart docker
验证docker代理是否设置成功


systemctl show --property=Environment docker  
显示如下结果说明设置成功


Environment=GOTRACEBACK=crash HTTP_PROXY=http://pill:pill@node2:3128/

原文地址:https://www.cnblogs.com/effortsing/p/10060856.html