Configuring docker http proxy

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

reference

https://docs.docker.com/config/daemon/systemd/

Guess you like

Origin www.cnblogs.com/ka1em/p/11299193.html