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

评论 24
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

I am oyjl

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值