docker 设置代理

docker 设置代理

 

Create or edit the /etc/systemd/system/docker.service.d/proxy.conf file and add:

[Service]
Environment="HTTP_PROXY=socks5://127.0.0.1:<PROXY_PORT>"
Environment="HTTPS_PROXY=socks5://127.0.0.1:<PROXY_PORT>"


Replace <PROXY_PORT> with your proxy port. Then, reload systemd and restart Docker:

sudo systemctl daemon-reload
sudo systemctl restart docker docker.service




来源:https://stackoverflow.com/questions/61590317/use-socks5-proxy-from-host-for-docker-build

posted on 2025-02-25 13:50  少杨  阅读(48)  评论(0)    收藏  举报