猫言猫语

严以律己·宽以待人·自强不息·知行合一

为 Docker 配置网络代理

| 为 Docker 配置网络代理已关闭评论

新建:/etc/systemd/system/docker.service.d/proxy.conf文件,文件内容如下:

[Service]
Environment="HTTP_PROXY=socks5://192.168.1.2:1080"
Environment="HTTPS_PROXY=socks5://192.168.1.2:1080"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"

然后重新启动 docker 服务

systemctl daemon-reload
systemctl restart docker

评论已关闭。