解决Client.Timeout exceeded while awaiting headers报错

在进行docker pull 拉取镜像时,出现过下面的错误:

net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

原因是国内下载官方镜像点提供的镜像时,速度缓慢,超时。使用加速器就可以解决这个问题。
笔者使用的是Centos7,首先需要创建配置文件daemon.json

vim /etc/docker/daemon.json

在文件中写入:

{
“registry-mirrors”:[“https://docker.mirrors.ustc.edu.cn”]
}

然后重启进程:

systemctl daemon-reload
systemctl restart docker

重新拉取镜像,问题解决!

发布了193 篇原创文章 · 获赞 139 · 访问量 30万+

猜你喜欢

转载自blog.csdn.net/qappleh/article/details/99880102