我正在尝试在Windows 10上使用
每次我运行
我在网上找了一些资料,有些人建议将DNS服务器设置为固定的地址:
我删除了所有的内容,只留下这些:
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 的建议,我查看了我的 hosts 文件,发现其中有几个条目与 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
然后事情开始正常运作。