docker 设置代理

1、创建目录

mkdir -p /etc/systemd/system/docker.service.d

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

[Service]
Environment=“HTTP_PROXY=http://10.245.3.1:8080/”

3、重启docker

systemctl daemon-reload
systemctl restart docker
 

4、验证docker代理是否设置成功

systemctl show --property=Environment docker

5、显示如下结果说明设置成功

Environment=GOTRACEBACK=crash HTTP_PROXY=http://10.245.3.1:8080/

加班不给钱