-
创建配置目录
mkdir /etc/systemd/system/docker.service.d
-
添加地址
cd /etc/systemd/system/docker.service.d
cat >/etc/systemd/system/docker.service.d/http_proxy.conf << EOF
[Service]
Environment="HTTP_PROXY=http://192.168.1.1:80/"
Environment="HTTPS_PROXY=http://192.168.1.1:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"
EOF
- 重启服务
systemctl daemon-reload
systemctl restart docker