Error “Get https://registry-1.docker.io/v2/: net/http: request canceled” while building image

后端 未结 11 1046
攒了一身酷
攒了一身酷 2020-12-13 19:01

I am getting the below error while building an image

Step 1/10 : FROM ubuntu:14.04
Get https://registry-1.docker.io/v2/: net/http: request canceled while wai         


        
相关标签:
11条回答
  • 2020-12-13 19:37

    I had the same issue and only found out after 30 minutes that I was on a VPN network for work which blocks other sites. I went off the VPN, and it worked :) This is definitely a network issue. When it said "not authenticated", I thought perhaps I needed some login credentials or so.

    0 讨论(0)
  • 2020-12-13 19:38

    I have same issue with registry deployed in swarm. Restart docker helps but after some time it occurs again.

    Redeploy registry with docker-compose

    sudo docker-compose up -d
    

    and all works fine

    0 讨论(0)
  • 2020-12-13 19:38

    I faced this issue on ubuntu when I am trying to build elasticsearch:

    And I got this error:

    ERROR: Get https://docker.elastic.co/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    

    It was my network connection problem. I was using VPN. so I disconnect my VPN connection and it's working fine.

    for some reasons, it's trying to look up the domain it seems trying to search for the domain inside the local network after I disconnect the VPN everything worked fine.

    0 讨论(0)
  • 2020-12-13 19:41

    I had the same problem and the following fix has worked for me: https://github.com/moby/moby/issues/22635#issuecomment-260063252

    In my case I've added the following 2 "nameserver" lines to /etc/resolv.conf file.

    before:

    nameserver 127.0.0.53
    

    after:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    nameserver 127.0.0.53
    
    0 讨论(0)
  • 2020-12-13 19:41

    I have faced this error sometimes, my docker image is built smoothly before but when I have to remove all images ( even I do not make any change with the docker configuration files or any error in code). this still happens.

    so I think that it may cause by the connection for it does a "Get https://registry-1.docker.io/v2/:....."

    I have change DNS to google DNS 8.8.8.8 and 8.8.4.4 then it 's worked. good luck!

    0 讨论(0)
提交回复
热议问题