目录

Docker运行hello-world镜像失败或超时Unable-to-find-image-hello-worldlatest-locally-Trying-to-pull-reposi

目录

Docker运行hello-world镜像失败或超时:Unable to find image ‘hello-world:latest‘ locally Trying to pull reposi

Docker运行hello-world镜像失败或超时,报错:Unable to find image ‘hello-world:latest’ locally

Trying to pull repository docker.io/library/hello-world …

/usr/bin/docker-current: missing signature key.

See ‘/usr/bin/docker-current run –help’.

如下图:

https://i-blog.csdnimg.cn/direct/9a0fcb3770bf4f13ab133ee5f8804bce.png

在安装 Docker 并尝试运行 hello-world 时,遇到 连接超时 的问题,这通常是因为 默认的 Docker 镜像源访问速度较慢或不稳定 所导致的。为了加速 Docker 镜像的下载和提升稳定性,解决这个问题的一种有效方法就是 更换镜像源

可以参考官方文档(阿里云)解决步骤:

我的解决方案

第一步:配置加速地址:设置registry mirror

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://do.nark.eu.org",
        "https://dc.j8.work",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn"
    ]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
systemctl status docker

第二步:重启完docker之后检查registry mirror刚刚配置的加速地址是否成功

docker info

看到:

https://i-blog.csdnimg.cn/direct/a76cb733ba434a8d80462e8d36361aea.png

https://i-blog.csdnimg.cn/direct/da40767863db4ceb919a2f11b25ca2a7.png

这里出现了Registy Mirrors。说明通过上面的命令已经配置成功。

第三步:运行docker run hello-world

docker run hello-world

https://i-blog.csdnimg.cn/direct/36b1a7fb82e2431c8c09e8fed12e3aae.png

此时我们也可以查看是否成功拉取hello-world镜像:

docker images

https://i-blog.csdnimg.cn/direct/31c8f8d75d424732ac7f57bfa2431d35.png

Docker运行hello-world镜像失败或超时的问题终于解决了。