You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows版Docker Desktop教程首命令失败:镜像拉取超时求助

解决Windows Docker Desktop拉取镜像超时问题

执行命令:

docker run --name repo alpine/git clone https://github.com/docker/getting-started.git

报错信息:

Unable to find image 'alpine/git:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

问题核心是Docker默认镜像仓库访问超时,导致无法拉取alpine/git镜像,以下是可行的解决方法:

  • 配置国内镜像源

    1. 打开Docker Desktop,点击右上角齿轮图标进入设置。
    2. 切换到Docker Engine选项卡,在JSON配置中添加国内镜像源,示例配置如下:
      "registry-mirrors": [
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com",
        "https://docker.mirrors.ustc.edu.cn"
      ]
      
    3. 点击Apply & Restart,等待Docker重启完成配置生效。
  • 手动拉取镜像后执行命令
    若配置镜像源后仍有问题,可先单独拉取目标镜像:

    docker pull alpine/git:latest
    

    拉取成功后再执行原命令即可。

  • 检查网络与代理设置

    1. 确认本地网络可正常访问外网,尝试ping registry-1.docker.io验证连通性。
    2. 若使用代理,需在Docker Desktop的Proxy设置中配置对应代理信息,确保Docker能通过代理访问镜像仓库。

内容的提问来源于stack exchange,提问作者eastwater

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 22:34:58