配置docker http代理

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://docs.docker.com/config/daemon/systemd/

posted @ 2019-08-04 18:38  ka1em  阅读(4498)  评论(0编辑  收藏  举报