root@hhh-virtual-machine:/home/hhh/桌面# docker info | grep -A1 “Registry Mirrors”
Registry Mirrors:
https://registry.cn-hangzhou.aliyuncs.com/
从 docker info 看,镜像加速器 https://registry.cn-hangzhou.aliyuncs.com/ 已正确配置。但拉取 hello-world 时报 pull access denied,这通常意味着该加速器无法代理您请求的镜像(可能是镜像不存在、权限问题或加速器本身限制)。阿里云公共加速器主要用于代理 Docker Hub 上的公共镜像,但某些区域可能对特定镜像做了限制。
下面我们更换为更稳定、无需登录的加速器,并验证 Docker 是否正常工作。
方案:更换为 DaoCloud 镜像加速器(推荐)
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://docker.m.daocloud.io"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
然后拉取一个确定存在的镜像 busybox 进行测试:
docker pull busybox
如果拉取成功,再尝试:
docker pull hello-world
如果 busybox 成功但 hello-world 依然失败,可能是 hello-world 仓库名特殊,您可以直接运行 docker run hello-world(它会自动拉取,如果失败可能显示更详细错误)。
验证结果
root@hhh-virtual-machine:/home/hhh/桌面# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
b05093807bb0: Pull complete
7270b3e1860c: Download complete
Digest: sha256:fd8d9aa63ba2f0982b5304e1ee8d3b90a210bc1ffb5314d980eb6962f1a9715d
Status: Downloaded newer image for busybox:latest
docker.io/library/busybox:latest
root@hhh-virtual-machine:/home/hhh/桌面# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
4f55086f7dd0: Pull complete
d5e71e642bf5: Download complete
Digest: sha256:c3cbe1cc1aa588a64951ac6286e0df7b27fe2e6324b1001c619bb358770c0178
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
root@hhh-virtual-machine:/home/hhh/桌面#
成功拉取了 busybox 和 hello-world 镜像,说明:
✅ 镜像加速器(DaoCloud)配置生效
✅ 网络连接正常
✅ Docker 拉取、认证均无问题

9119

被折叠的 条评论
为什么被折叠?



