
尝试了很多方法,依然无法拉取镜像
$ 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。
以上方法都不生效。
1 user100saysth 2024-07-11 13:33:41 +08:00 前几天弄过 centos7 的,供参考 docker 配置代理------ sudo mkdir -p /etc/systemd/system/docker.service.d 984 sudo touch /etc/systemd/system/docker.service.d/proxy.conf 985 vi /etc/systemd/system/docker.service.d/proxy.conf ``` [Service] EnvirOnment="HTTP_PROXY=http://localhost:7890/" EnvirOnment="HTTPS_PROXY=http://localhost:7890/" EnvirOnment="NO_PROXY=localhost,127.0.0.1,.example.com" ``` sudo systemctl daemon-reload sudo systemctl restart docker |
2 vhui 2024-07-11 13:37:05 +08:00 |
3 xR13zp0h67njQr2S 2024-07-11 13:37:38 +08:00 docker desktop -》 setting -》 resources -》 proxies |
4 xR13zp0h67njQr2S 2024-07-11 13:40:39 +08:00 |
5 zhuisui 2024-07-11 13:43:09 +08:00 修改 daemon.json 法肯定是有用的 |
6 xubeiyan 2024-07-11 14:01:38 +08:00 用`docker info` 看看是否设置中有 ``` HTTP Proxy: socks5://127.0.0.1:7890 HTTPS Proxy: socks5://127.0.0.1:7890 ``` 类似的项目,还有就是改了配置需要使用`systemctl restart docker`重新载入 docker |
7 fugu37 2024-07-11 14:27:19 +08:00 因为 docker 只支持 linux ,macos 和 windows 都要用虚拟机兼容,配置方法自然和正常的 docker 不一样 |
8 Volekingsg 2024-07-11 15:07:42 +08:00 macOS 下面一个比较简单的方式,开个增强模式(即虚拟网关),Surge 和 Clash 一般都支持 |
9 wnpllrzodiac 2024-07-11 15:47:33 +08:00 cf 大法岂不美哉 |
10 wu67 2024-07-11 15:52:24 +08:00 最近的版本好像有 bug. 我之前一直是在 docker 设置里面设置 127+端口的. 今天更新发现这个设置失效了. 然后把 docker 设置面板里面代理关掉, 让他自己走系统代理就好了 |
11 beginor 2024-07-11 16:42:28 +08:00 via Android Docker 在 Mac 上是虚拟机, 所以 Mac 上使用 127.0.0.1 作为代理地址是肯定不行的, 必须设置成 Mac 本机的内网 IP 地址才能使用。 或者使用 Proxifier 来设置代理规则也行。 |
12 ymcyyf 2024-07-11 17:36:17 +08:00 |
13 Yuesh1 2024-07-11 17:43:42 +08:00 把 127.0.0.1 改成 host.docker.internal 127.0.0.1 访问的是 mac 的 docker 起的一个虚拟机 |
15 tr1v1z 2024-07-11 19:37:56 +08:00 via Android |
16 zsh2517 2024-07-11 19:49:29 +08:00 |
17 leokun 2024-07-11 20:54:40 +08:00 tun 模式可以 |
18 luodan 2024-07-12 05:30:06 +08:00 楼上说的增强模式应该是最方便的。随时开启,随时关闭。 |
19 skuuhui 2024-07-12 08:49:48 +08:00 “按照官方文档 Configure the daemon to use a proxy 修改 ~/.docker/daemon.json”我是生效的,如果不行,那就是镜像源有问题。 哦,你拉取的时候得 docker pull <源域名>/busybox |
20 zbatman 2024-07-12 08:52:54 +08:00 via Android 只是拉镜像的话,用 cf workers 或者用 cf 套 nginx 自己搭建一个就行吧,cf 在国内应该还是可以访问的 |
21 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 不能使用。 |
22 svyrblg 2024-07-23 21:28:38 +08:00 已经经过测试 |