请问大佬, MacOS 下如何设置 docker 使用本地代理?

2024-07-11 13:29:52 +08:00
 lucasj

尝试了很多方法,依然无法拉取镜像

$ docker pull busybox

Using default tag: latest
latest: Pulling from library/busybox
213a27df5921: Retrying in 1 second
error pulling image configuration: download failed after attempts=6: net/http: TLS handshake timeout

方法一:设置终端代理

export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890

方法二:设置 daemon.json

按照官方文档 Configure the daemon to use a proxy 修改 ~/.docker/daemon.json

以上方法都不生效。

4502 次点击
所在节点    程序员
22 条回复
svyrblg
2024-07-23 21:28:08 +08:00
1 、通过界面设置
docker desktop -》 setting -》 resources -》 proxies
2 、通过配置文件设置
"proxies": {
"default": {
"httpProxy": "http://127.0.0.1:20171",
"httpsProxy": "http://127.0.0.1:20171"
}
},
注意:只能使用 http 协议,socks5 不能使用。
svyrblg
2024-07-23 21:28:38 +08:00
已经经过测试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1056546

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX