admin管理员组文章数量:1130349
使用方式
新建或修改~/.docker/config.json文件,设置可用的代理地址。
{
"proxies": {
"default": {
"httpProxy": "http://192.168.0.32:1080",
"httpsProxy": "http://192.168.0.32:1080",
"noProxy": "localhost"
}
}
}
重启docker。
注:经测试,这种方式仅对后面新建的容器生效,已经存在的容器似乎并不生效。若要更改已经存在的容器,可以使用下面的更改/etc/environment的方法。
附:linux中git使用代理
设置
git config --global http.https://github.proxy socks5://192.168.0.32:1080
取消
git config --global --unset http.https://github.proxy
附:linux使用全局代理
编辑/etc/environment
export http_proxy="http://192.168.0.32:1080/"
export https_proxy="http://192.168.0.32:1080/"
然后source /etc/environment。
使用方式
新建或修改~/.docker/config.json文件,设置可用的代理地址。
{
"proxies": {
"default": {
"httpProxy": "http://192.168.0.32:1080",
"httpsProxy": "http://192.168.0.32:1080",
"noProxy": "localhost"
}
}
}
重启docker。
注:经测试,这种方式仅对后面新建的容器生效,已经存在的容器似乎并不生效。若要更改已经存在的容器,可以使用下面的更改/etc/environment的方法。
附:linux中git使用代理
设置
git config --global http.https://github.proxy socks5://192.168.0.32:1080
取消
git config --global --unset http.https://github.proxy
附:linux使用全局代理
编辑/etc/environment
export http_proxy="http://192.168.0.32:1080/"
export https_proxy="http://192.168.0.32:1080/"
然后source /etc/environment。
版权声明:本文标题:Docker设置代理、Linux系统设置代理 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1754876850a2738128.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论