1、在进行docker pull 拉取镜像时,出现过下面的错误:
[root@localhost /]# docker pull centos
Using default tag: latest
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)
2、使用加速器就可以解决这个问题。以Centos7为例,首先需要创建配置文件daemon.json
vim /etc/docker/daemon.json
在文件中写入:
{
“registry-mirrors”:[“https://docker.mirrors.ustc.edu.cn”]
}
然后重启进程:
systemctl daemon-reload
systemctl restart docker
重新拉取镜像,问题解决!