其他分享
首页 > 其他分享> > 执行docker run命令时报错Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for

执行docker run命令时报错Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for

作者:互联网

一.解决办法: 修改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

  

标签:8.8,40,canceled,while,registry,io,docker,151.211
来源: https://www.cnblogs.com/dakewei/p/10831125.html