docker报错 无法连接registry-1.docker.io,pull镜像失败
简介: docker pull命令拉取镜像失败的解决方案 docker pull命令拉取镜像失败的解决方案
一、执行docker pull命令,拉取镜像失败:Error response from daemon: Get “https://registry-1.docker.io/v2/”: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
二、解决方案 解决的步骤如下:
- 打开daemon.json文件
sudo nano /etc/docker/daemon.json```
2. 将其镜像地址进行替换
```bash
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://registry.docker-cn.com",
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"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://mirror.baidubce.com"
]
}
三、重启docker服务
systemctl daemon-reload
systemctl restart docker