Error response from daemon: Get “https://registry-1.docker.io/v2/“: net/http: request canceled
·
在ubuntu中安装docker后运行sudo docker pull hello-world出现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)
我查看了很多网站上的解决方法,但是经过我个人的尝试发现我需要配置两个文件才可以解决这个问题
- 配置DNS
sudo vim /etc/resolv.conf

2. 修改docker的daemon.json文件为以下内容sudo vim /etc/docker/daemon.json
{
"max-concurrent-downloads": 10,
"max-concurrent-uploads": 5,
"default-shm-size": "1G",
"debug": true,
"experimental": false,
"registry-mirrors":[
"https://x9r52uz5.mirror.aliyuncs.com",
"https://dockerhub.icu",
"https://docker.chenby.cn",
"https://docker.1panel.live",
"https://docker.awsl9527.cn",
"https://docker.anyhub.us.kg",
"https://dhub.kubesre.xyz"
]
最终成功拉取镜像
至于为什么会是这两个条件一起才解决这个问题,我当时配置了DNS文件,但没有添加上面的镜像的时候运行pull得到的报错信息是error pulling image configuration: download failed after attempts=6: dial tcp 108.160.170.26:443: connect: connection refused,
后边看了一篇作者的文章又去修改daemon.json文件才顺利pull下来。(同时这个DNS的配置好像会自己修改回去)
更多推荐



所有评论(0)