如何解决docker 登录问题 - 等待连接时请求取消
突然间 docker 在我的系统中显示了一个奇怪的问题。
docker login
间歇性失败,docker pull
根本不工作:(.
这是 docker login 成功但 docker pull 失败并出现错误的一个实例。
$ docker login
Authenticating with existing credentials...
Login Succeeded
$ docker pull cooldocker19/manas-simple-flask:latest
Error response from daemon: Head https://registry-1.docker.io/v2/cooldocker19/manas-simple-flask/manifests/latest: Get https://auth.docker.io/token?account=cooldocker19&scope=repository%3Acooldocker19%2Fmanas-simple-flask%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
当我从浏览器或邮递员尝试上述 url ( ref: https://auth.docker.io/token?) 时,它按预期返回正确的 access_token,但不确定为什么 docker daemon 无法获取它。
我关注了多个 docker/StackOverflow 线程,其中有几个人报告了这个问题。 例如:
- https://github.com/moby/moby/issues/22635#issuecomment-260063252
- Client timeout exceeded while awaiting headers
- https://github.com/docker/for-win/issues/1534
我按照几个线程中的建议添加了以下 DNS,但没有任何帮助。在尝试了不同的设置并花费了超过 4/5 个小时后,我有点筋疲力尽。如果您知道如何解决此问题,请告诉我。
{
"dns": [
"8.8.8.8","8.8.4.4"
]
}
PN - 我可以从托盘图标登录到 docker hub。
更新 1 根据我朋友的建议,我尝试将上述 DNS 地址添加到我的系统(Mac)DNS 配置中,但这没有帮助。
参考:https://osxdaily.com/2015/12/05/change-dns-server-settings-mac-os-x/
更新 2 我尝试使用 dig 和 nslookup 进行故障排除。
我发现带有 registry-1.docker.io 的 dig 命令间歇性地(20% 时间)失败。如上所述,最近几天我的系统没有显着变化。
不确定它是否表明该服务器或我的互联网(系统)存在问题!!
这是日志(查找失败)
$ dig @8.8.8.8 registry-1.docker.io
; <<>> DiG 9.10.6 <<>> @8.8.8.8 registry-1.docker.io
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。