Docker 拉取镜像报错


问题一
[root@localhost Try]# docker search nginx
Error response from daemon: Get “https://index.docker.io/v1/search?q=nginx&n=25”: dial tcp 31.13.96.193:443: connect: connection refused
解决:
docker search 镜像加速地址/[imageName]

不是直接docker search [imageName]
改成
docker search docker.1ms.run/nginx

问题二
[root@localhost Try]# docker pull nginx
Using default tag: latest
Error response from daemon: Get “https://registry-1.docker.io/v2/”: dial tcp 157.240.17.14:443: i/o timeout

解决办法:

# 查看daemon配置
[root@localhost Try]# cat /etc/docker/daemon.json

# 修改daemon配置
[root@localhost Try]# sudo tee /etc/docker/daemon.json <<-'EOF'
{
 "registry-mirrors":["https://a88uijg4.mirror.aliyuncs.com","https://docker.lmirror.top","https://docker.m.daocloud.io", "https://hub.uuuadc.top","https://docker.anyhub.us.kg","https://dockerhub.jobcher.com","https://dockerhub.icu","https://docker.ckyl.me","https://docker.awsl9527.cn","https://docker.laoex.link"]
}
EOF

#重载systemd管理守护进程配置文件
[root@localhost Try]# systemctl daemon-reload

#重启 Docker 服务
[root@localhost Try]#  systemctl restart docker 


Logo

码道开发者社区,聚焦华为云码道 CodeArts 代码智能体,沉淀 Agent、Skill、鸿蒙开发实战内容,供开发者查阅资料、交流技术、分享工程实践

更多推荐