一.解决办法: 修改host

二.步骤如下

  2.1 安装dig工具

     sudo apt-get install dnsutils -y (ubuntu下的安装方法)

  2.2 找到registry-1.docker.io对应的ip地址    

    jello$ dig @8.8.8.8 registry-1.docker.io

    ; <<>> DiG 8.8 hello <<>> @8.8.8.8 registry-1.docker.io
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6620
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ;; QUESTION SECTION:
    ;registry-1.docker.io. IN A

    ;; ANSWER SECTION:
    registry-1.docker.io. 40 IN A 34.201.236.93
    registry-1.docker.io. 40 IN A 34.206.236.31
    registry-1.docker.io. 40 IN A 34.233.151.211
    registry-1.docker.io. 40 IN A 34.228.211.243
    registry-1.docker.io. 40 IN A 52.22.67.152
    registry-1.docker.io. 40 IN A 34.201.196.144
    registry-1.docker.io. 40 IN A 52.22.201.61
    registry-1.docker.io. 40 IN A 34.232.31.24

    ;; Query time: 162 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Mon August 8 8:8:8 CST 2018
    ;; MSG SIZE rcvd: 177

  2.3 修改hosts表

    echo 34.233.151.211 registry-1.docker.io > /etc/hosts

补充:

  方法二:添加dns 8.8.8.8

    a 将nameserver 8.8.8.8写入/etc/resolvconf/resolv.conf.d/head文件中

      sudo vi /etc/resolvconf/resolv.conf.d/head

    b 更新dns

      sudo resolvconf -u

  方法三:修改镜像源

    a sudo vi /etc/docker/daemon.json

      写入以下内容:     

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

    b 重新加载docker的配置文件

      sudo systemctl daemon-reload

    c 重启docker

      sudo systemctl restart docker

执行docker run命令时报错Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)的更多相关文章

  1. 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 pull nginx 遇到这个问题 Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: ...

  2. docker报错:Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

    在github上开到这样一条 于是 这两个选项换着来 具体怎么回事,咱也不知道,咱也不敢问 改完后蹭蹭的

  3. docker拉取慢(net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting head)

    systemctl restart docker在docker-hub拉取慢,因为服务器在外网 直接配置阿里云镜像就可以 首先: vim /etc/docker/daemon.json加入下面的那句 ...

  4. 阿里云 docker连接总报超时 registry.cn-hangzhou.aliyuncs.com (Client.Timeout exceeded while awaiting headers

    Error response from daemon: Get https://registry.cn-hangzhou.aliyuncs.com/v2/: net/http: request can ...

  5. Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Clien

    https://blog.csdn.net/asahinokawa/article/details/84746422

  6. 【docker问题】Client.Timeout exceeded while awaiting headers

    在进行docker pull 拉取镜像时,出现过下面的错误: net/http: request canceled while waiting for connection (Client.Timeo ...

  7. docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers).

    docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled ...

  8. 【docker】centos7 上拉取docker镜像,一直拉取不到,报错:Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while w

    镜像拉取一直报错: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request cancel ...

  9. docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled

    故障描述: [root@docker01 ~]# docker run centos docker: Error response from daemon: Get https://registry- ...

随机推荐

  1. head pose estimation

    opencv:帖子中介绍了算法原理和opencv估计姿态的代码 https://www.learnopencv.com/head-pose-estimation-using-opencv-and-dl ...

  2. 解决xshell连接不上阿里云服务器问题

    最近购买了阿里云服务器准备玩玩,但是使用xshell连接阿里云服务器时,系统一直提示“Connection established. To escape to local shell, press ' ...

  3. 原创:(一)TCP/IP学习笔记之概述

    端到端论点和命运共享其实不应该在底层,差错控制应该在应用程序附近来实现.这是因为考虑了连接,而不是传输的准确,因为差错可以根据某些算法(通信中的滤波等)来恢复,不过在大面积网络出现问题的时候有必要进行 ...

  4. eclipse集成springboot 插件(离线安装,含解决Cannot complete the install because one or more required items could)

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/li18310727696/article/details/81071002首先,确认eclipse的 ...

  5. python常用模块:re模块案例、subprocess

    今日内容: 一.re模块二.re练习三.subproces模块 一.re模块 import re # [] 范围匹配 中间 用-来连接 # re.findall("[a-zA-Z0-9]&q ...

  6. 使用ViewPager实现导航

    1.使用PageAdapter适配器 2.使用FragmentPageAdapter适配器 监听事件: OnPageChangeListener 百度云:链接: http://pan.baidu.co ...

  7. Ubuntu18.04系统执行语句时出现错误Failed to load module "canberra-gtk-module"

    Ubuntu18.04系统执行gnuradio-companion时,命令行提示错误Failed to load module "canberra-gtk-module",虽然看起 ...

  8. spring cache会默认使用redis作为缓存吗?

    web项目中,只需要配置 redis 的IP,端口,用户名和密码就可以使用redis作为缓存了,不需要在在java 代码中配置redisConfig,redisConfig只是作为缓存配置的辅助,比如 ...

  9. JavaScript16进制颜色值和rgb的转换

    //十六进制颜色值域RGB格式颜色值之间的相互转换//十六进制颜色值的正则表达式 var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; /*RGB颜色转换为1 ...

  10. 数据类型之字符串类型与Number类型

    ㈠字符串类型 ⑴在JS中字符串需要使用引号引起来 ⑵使用双引号或单引号都可以,但是不要混着用 ⑶引号不能嵌套,双引号不能放双引号,单引号不能放单引号 ⑷在字符串中,可以使用“\”作为转义字符,当表示一 ...