mkdir -p /etc/systemd/system/pkg-ContainerManager-dockerd.service.d
touch /etc/systemd/system/pkg-ContainerManager-dockerd.service.d/http-proxy.conf
vim /etc/systemd/system/pkg-ContainerManager-dockerd.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://10.8.8.100:7980"
Environment="HTTPS_PROXY=http://10.8.8.100:7980"
Environment="NO_PROXY=localhost,127.0.0.1"
[Service]
Environment="HTTP_PROXY=socks5://192.168.1.3:10808"
Environment="HTTPS_PROXY=socks5://192.168.1.3:10808"
Environment="NO_PROXY=localhost,127.0.0.1"
[Service]
Environment="HTTP_PROXY=socks5://用户名:密码@192.168.1.3:10808"
Environment="HTTPS_PROXY=socks5://用户名:密码@192.168.1.3:10808"
Environment="NO_PROXY=localhost,127.0.0.1"
重启运行验证
systemctl daemon-reload
systemctl restart pkg-ContainerManager-dockerd.service
systemctl show --property=Environment pkg-ContainerManager-dockerd.service