本文最后更新于 63 天前,其中的信息可能已经有所发展或是发生改变。
在 Linux 环境下,终端 pull docker image 时,未使用科学上网会报错找不到 dockerhub 服务器,使用科学上网,需要开启 tun 模式完全代理流量,系统代理流量无法经过 docker 使用端口,此时也找不到服务器。
在使用 wsl 时,可以通过 Windows 上的 docker desktop 搜索和 pull image,但是也需要通过代理,此时走 443 端口,系统代理可以完成 pull image,如果开启了 tun 模式毫无疑问是可以 pull image 的。
使用指令 docker pull <image> 时,网速稍差亦可使用,但是在使用 docker compose up 指令构建镜像时,网速太差会在 pull image 十多秒后中断 pull ,报错为 error response from daemon: Get ” https://rejistry-1.docker.io/v2/ “: EOF
因此建议 docker compose 文件编写时使用已经拉取的 image,不要使用 tag:latest,使用 wsl pull image 时,建议在 docker desktop 下载。
膜拜大佬
嘛,我还很菜啦