How to fix Docker's “Error pulling image…too many redirects” failures while pulling images from registry?

后端 未结 6 1680
难免孤独
难免孤独 2020-12-08 07:10

I am running Docker via CoreOS and Vagrant on OS X 10.10.

When I run docker pull ubuntu in CoreOS, I got following errors:

$ docker pull         


        
相关标签:
6条回答
  • 2020-12-08 07:51

    10.0.2.3 is virtualbox dns server, check Fine-tuning the VirtualBox NAT engine

    You can as other suggested use 8.8.8.8 which is google dns server.

    # /etc/resolve.conf
    nameserver 8.8.8.8
    

    And if you work in intranet, then replace it with your normal dns server, which you can add search as well like below

    # /etc/resolve.conf
    nameserver xxx.xxxx.xxx
    search company.com
    

    This will be good to access your private repo

    0 讨论(0)
  • 2020-12-08 07:57

    On MacOSX, if you use Docker Machine you can try to:

     docker-machine ls
     docker-machine ssh YOUR_VM_NAME
    

    and then from within the VM: kill the /usr/local/bin/docker process and start it again by hand:

     sudo /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// -H tcp://0.0.0.0:2376 --label provider=virtualbox --tlsverify --tlscacert=/var/lib/boot2docker/ca.pem --tlscert=/var/lib/boot2docker/server.pem --tlskey=/var/lib/boot2docker/server-key.pem -s aufs
    

    Funnily enough, restarting like this

    sudo /etc/init.d/docker restart
    

    does not help.

    0 讨论(0)
  • 2020-12-08 07:59

    I don't know about OS X, but on linux this could happen due to "bad" /etc/resolv.conf on the host. For example, ubuntu puts something like:

    nameserver 127.0.1.1
    

    and then handles the DNS requests through some service. The problem is, that this is accessible from inside of the image.

    To fix this, I had to add some external nameservers, like:

    nameserver 127.0.1.1
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    
    0 讨论(0)
  • 2020-12-08 08:02

    Try this temporary workaround:

    osx$ boot2docker up
    osx$ boot2docker ssh
    docker@boot2docker$ sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf
    docker@boot2docker$ sudo /etc/init.d/docker restart
    

    It works until reboot.

    0 讨论(0)
  • 2020-12-08 08:02

    On windows I was able to fix it by doing the following:

    1. Go to virtual box application
    2. Delete the VM that was created
    3. Restart computer (optional, i think)
    4. Start Kitematic
    5. Go back to Virtual Box, hit show
    6. Make sure ping google.com command works

    Now I am able to download docker images from the hub.

    0 讨论(0)
  • 2020-12-08 08:13

    I had a similar issue when trying to pull a container from docker repository with this command :
    docker pull ubuntu

    Note that I was using coreos inside virtualbox and I was using Nat as my Networking Configuration to have access to internet. When Switching network modes with virtualbox, I couldn't do any pull.

    I solved the issue by restarting docker with systemctl by iniating this command :
    sudo systemctl restart docker

    And then my pull worked fine. I hope this solution helped you. And I got it from from google group issue addressed by one of CoreOS creators(Brandon Philips) through this link: https://groups.google.com/forum/#!topic/coreos-dev/vWqSbPgNYro

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