代码之家  ›  专栏  ›  技术社区  ›  Felipe

Docker Windows超时

  •  0
  • Felipe  · 技术社区  · 6 年前

    我正在尝试使用Windows 10配置环境 docker docker-compose ,但我无法从docker注册表中提取图像。

    每次我跑 docker-compose up -d ,我得到以下错误:

    Pulling queue (redis:)...
    ERROR: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: read udp 192.168.65.3:36785->192.168.65.1:53: i/o timeout
    

    我在网上查看了一下,一些人建议将DNS服务器设置为固定的: 8.8.8.8 .我这么做了,但我还是有问题。

    使现代化

    根据@kaki的建议,我查看了我的主机文件,看到了几个关于docker的条目:

    100.114.69.30 host.docker.internal
    100.114.69.30 gateway.docker.internal
     host.docker.internal
     gateway.docker.internal
     192.168.1.103 host.docker.internal
     192.168.1.103 gateway.docker.internal
    # Added by Docker Desktop
     192.168.0.11 host.docker.internal
     192.168.0.11 gateway.docker.internal
    # To allow the same kube context to work on the host and the container:
    127.0.0.1 kubernetes.docker.internal
    # End of section
    

    我删除了所有这些,但这些:

    100.114.69.30 host.docker.internal
    100.114.69.30 gateway.docker.internal
    127.0.0.1 kubernetes.docker.internal
    # End of section
    

    事情开始起作用了。

    1 回复  |  直到 6 年前
        1
  •  4
  •   kaki gadol    6 年前

    出于某种原因,你的网络适配器认为这个域可以在你的局域网中找到,为了解决这个问题,我会尝试看看你的 C:\Windows\System32\drivers\etc\hosts 已更改为此值(计算机在查询dns服务器之前检查主机文件)。
    如果这个不能解决问题,我会向网络管理员询问这个问题,以防您在企业环境中工作,否则如果是私有的,我会检查路由器设置。

        2
  •  0
  •   D S    6 年前

    我也面临着同样的问题。我已尝试从主机文件中删除以下行

    由Docker Desktop添加

    100.114.69.30主持人。码头工人。内部的
    100.114.69.30网关。码头工人。内部的
    127.0.0.1库伯内特斯。码头工人。内部的

    节末

    但在编写命令行时仍然存在同样的问题——docker登录;在地狱里。然后,我使用docker桌面故障排除选项清理数据,并重新启动docker,它正在工作 enter image description here

    下面是PowerShell脚本

    enter image description here

    推荐文章