问题描述

使用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)

解决办法

配置国内镜像

查看博客:Docker配置阿里云镜像仓库

添加DNS地址

如果配置了国内镜像地址还是报错,就添加DNS地址,在/etc/resolv.conf中添加两行代码:

1
2
nameserver 8.8.8.8
nameserver 8.8.4.4

重启一下Docker

1
systemctl restart docker