Skip to content
决策参考

不知道选哪家?

根据你的预算、设备与 AI / 流媒体需求,获取客观匹配建议。

进入选择指南 →
🔥 本期推荐★ 4.8
光速云

2020 老牌综合专线,IEPL 企业内网 + VLESS 协议,全场景流媒体与 AI 加速

¥17 / 月IEPL 企业内网专线

Docker Hub 镜像拉取失败、npm 与 pip 下载超时代理配置终极方案

快速答案
实测有效配置
解决开发工具超时的最佳路径:
  • 1. Docker Desktop 需在 Settings -> Resources -> Proxies 中配置 HTTP/HTTPS 代理为 http://127.0.0.1:7897
  • 2. npm 执行 npm config set proxy http://127.0.0.1:7897
  • 3. pip 执行 pip config set global.proxy http://127.0.0.1:7897
  • 4. 或者在 Clash Verge 中开启 TUN 模式直接全局透明接管。
核心结论
彻底解决 image pull failed 与 ConnectTimeoutError。

一、Docker Hub 镜像拉取代理配置

自 2024 年下半年起,国内绝大部分公开 Docker 镜像加速站(包括各大高校与云厂商镜像源)被下架或限制访问,直接导致 docker pull 提示 toomanyrequestsClient.Timeout exceeded

1. Windows / macOS Docker Desktop 配置方法

  1. 打开 Docker Desktop 界面,点击右上角 ⚙️ Settings(设置)
  2. 导航至 Resources(资源)Proxies(代理)
  3. 勾选 Manual proxy configuration(手动代理配置)
  4. 填入你的本地代理客户端端口(以 Clash Verge 为例):
    • Web Server (HTTP): http://127.0.0.1:7897
    • Secure Web Server (HTTPS): http://127.0.0.1:7897
    • Bypass for these hosts & domains: localhost,127.0.0.1
  5. 点击 Apply & restart,重启 Docker 后即可秒级拉取官方镜像。

二、npm / yarn / pnpm 命令行代理配置

bash
# 设置 npm 代理
npm config set proxy http://127.0.0.1:7897
npm config set https-proxy http://127.0.0.1:7897

# 如需取消恢复
npm config delete proxy
npm config delete https-proxy

# 设置 yarn 代理
yarn config set proxy http://127.0.0.1:7897
yarn config set https-proxy http://127.0.0.1:7897

三、Python pip / conda 代理配置

bash
# 临时走代理安装单个包
pip install --proxy http://127.0.0.1:7897 torch torchvision

# 全局永久配置 pip 代理
pip config set global.proxy http://127.0.0.1:7897

# 如需取消 pip 代理
pip config unset global.proxy

🧭

下一步建议

根据你的当前进度,我们为你规划了以下最合理的后续路径:

商业决策导流

正在寻找优质稳定的机场服务? 避免踩坑与被封锁,先看 12 维度选择框架再做决定。

查看机场怎么选 →