首页 前端知识 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 reposi

2025-03-14 12:03:15 前端知识 前端哥 628 853 我要收藏

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镜像失败或超时的问题终于解决了。

转载请注明出处或者链接地址:https://www.qianduange.cn//article/23677.html
标签
评论
会员中心 联系我 留言建议 回顶部
浏览器升级提示:您的浏览器版本较低,建议您立即升级为知了极速浏览器,极速、安全、简约,上网速度更快!立即下载
复制成功!