mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/https-proxy.conf << EOF
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/" "HTTPS_PROXY=https://proxy.example.com:443/" "NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,"
EOF
systemctl daemon-reload
systemctl restart docker
systemctl show --property=Environment docker
转载于:https://www.cnblogs.com/ka1em/p/11299193.html