创建插件目录
sudo mkdir -p /etc/systemd/system/docker.service.d
编写proxy配置文件
#vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.server.com:913/" "HTTPS_PROXY=http://proxy.server.com:913/" "NO_PROXY=localhost,127.0.0.1,10.96.0.0/16, 10.244.0.0/16"
重启docker daemon
sudo systemctl daemon-reload
sudo systemctl restart docker systemctl show --property=Environment docker
/etc/systemd/system/docker.service.d