一.解决办法: 修改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. 卡片拖拽(vue拖拽事件)

    <template> <div class="wrapper wrapper-content" id="main" v-cloak> & ...

  2. vue +echarts树状图

    <template> <div :class="className" :id="id" :style="{height:height ...

  3. (转)从斐波那契数列看Java方法的调用过程

    斐波那契数列的定义: 斐波那契数列(Fibonacci sequence),又称黄金分割数列,因数学家列安纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔 ...

  4. linux 重定向类型 超级块 i节点

    超级块:定义文件系统的元数据(总大小.块大小.空闲.......):在格式化的时候确定 查看超级块信息:tune2fs  -l   目录 i节点:定义文件的元数据(名称.大小.存放位置.权限.修改时间 ...

  5. Ubuntu .tar.xz文件解压缩命令

    1.解压缩.tar.xz文件 这是两层压缩,外面是xz压缩方式,里层是tar压缩 所以可以分两步实现解压 $ xz -d filename.tar.xz $ tar -xvf filename.tar ...

  6. ACwing 196. 质数距离

    #include <bits/stdc++.h> using namespace std; , M = ; int v[M]; long long prime[N],prim[N]; ; ...

  7. oracle plsql登陆用户名密码都正确,拒绝登陆

    先通过sqlplus  或者 sql developer 或者其他用户登陆 然后更改 登陆不上的用户的密码  然后再用plsql登陆就可以了  然后还可以再把用户密码再改回来 也可以登陆了

  8. Linux配置python环境1,pyenv

    安装pyenv sudo apt-get install curl git curl -L https://github.com/pyenv/pyenv-installer/raw/master/bi ...

  9. Java常用类(一)Math类和Random类

    一.Math类 Math类中有一些常用的数学函数,比较简单,不进行详细解释,仅举例说明: 1.绝对值和取整 import java.lang.Math; public class Mat { publ ...

  10. PLS做soft particle

    这个pixel local storage frame fetch 可以一个pass做出soft particle/deferred lighting/soft edge water programb ...