我正在尝试使用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
事情开始起作用了。