最近docker又抽风了,拉取镜像一直报连接超时的错误

 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).
 Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp ip: connect: connection refused

遇到这种超时错误基本就是国内镜像拉取不了的问题,解决方案就是更换能连接的国内镜像就可以了,其他的配置host什么都没有用。

亲测几个能用的国内镜像,速度很快,但不知道什么时候会失效,先用着吧,在/etc/docker/daemon.json添加

"registry-mirrors": [
        "https://docker.1ms.run",
        "https://docker.xuanyuan.me",
        "https://docker.rainbond.cc",
        "https://do.nark.eu.org",
        "https://dc.j8.work"
    ],

保存后执行

sudo systemctl daemon-reload
sudo systemctl restart docker

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐