Linux · 2023-12-04

Docker使用socks5代理

sudo mkdir -p /etc/systemd/system/docker.service.d

sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment=”HTTP_PROXY=socks5://127.0.0.1:1080″ “HTTPS_PROXY=socks5://127.0.0.1:1080” “NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com”

sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl show –property=Environment docker