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’.
如下图:
在这里插入图片描述
在安装 Docker 并尝试运行 hello-world 时,遇到连接超时的问题,这通常是因为默认的 Docker 镜像源访问速度较慢或不稳定所导致的。为了加速 Docker 镜像的下载和提升稳定性,解决这个问题的一种有效方法就是更换镜像源

可以参考官方文档(阿里云)解决步骤:
https://cr.console.aliyun.com/cn-shenzhen/instances/mirrors

我的解决方案
第一步:配置加速地址:设置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

看到:
在这里插入图片描述
在这里插入图片描述
这里出现了Registy Mirrors。说明通过上面的命令已经配置成功。

第三步:运行docker run hello-world

docker run hello-world

在这里插入图片描述

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

docker images

在这里插入图片描述
Docker运行hello-world镜像失败或超时的问题终于解决了。

猜你喜欢

转载自blog.csdn.net/oyjl__/article/details/143522664
今日推荐