docker报错Error response from daemon
问题描述
[vagrant@docker ~]# docker pull hello-world
docker: 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).
解决方案:
修改docker镜像源,docker默认的源为国外官方源,下载速度较慢,可改为国内
进入/etc/docker
,查看有没有daemon.json
。这是docker默认的配置文件。如果没有新建,如果有,则修改。
[vagrant@docker ~]# vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com"]
}
保存退出。重启docker服务
[vagrant@docker ~]# systemctl restart docker.service