zl程序教程

您现在的位置是:首页 >  其他

当前栏目

解决docker 拉取镜像报错问题——Using default tag: latest Error response from daemon: Get “https://registry-(全)

2023-04-18 16:25:33 时间

   如下图,docker无法拉取镜像。

(以下操作均要在root条件下进行)

1. 我们需要检查daemon.json文件并对其进行编辑。

提醒一下使用国内镜像加速的

装docker默认没有这个文件的,需要自己创建,问题不大。

使用阿里云的镜像加速就行。

{"registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com"]}

2.重启服务

systemctl daemon-reload
systemctl restart docker

3.然后通过dig @114.114.114.114 registry-1.docker.io找到可用IP(需要检测好自身网络是否正常连接)

 如44.205.64.79

4.添加到host解析

cat /etc/hosts

添加的是这一句

44.205.64.79    registry-1.docker.io

5.重新拉取镜像检测一下是否完整