Docker can't connect to boot2docker because of TCP timeout

后端 未结 12 2015
遇见更好的自我
遇见更好的自我 2021-01-29 20:59

I\'m running Mac OS 10.9.5 (Mavericks), I\'ve followed https://docs.docker.com/installation/mac/ to install Docker. I get a timeout error message when I run Docker even though t

12条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-29 21:03

    This happened to me as well, and none of the previous answers fixed the problem.

    Today, thanks to a colleague's suggestion, I did not startup my VPN connection first. I rebooted my machine, and started with Docker from the beginning.

    boot2docker init
    boot2docker up
    $(boot2docker shellinit)
    docker run hello-world
    

    It worked as expected!

    I found this post by Florian Rosenberg useful. I read through it in detail, but I think most of what he is suggesting in the first part has been factored into the most recent version of boot2docker. But the insightful bit was "Connecting to VPN Things will break".

    It suggested to look for a firewall rule that denies any to any. So, without VPN fired up I looked for this rule, and it was not there. Sure enough, once I fired up my VPN, I got the following (different) error...

    docker run hello-world
    2014/11/13 11:11:18 Post https://192.168.59.103:2376/v1.15/containers/create: dial tcp 192.168.59.103:2376: permission denied
    

    I checked the firewall rules, and sure enough a new rule was added...

    sudo ipfw -a list | grep "deny ip"
    00411    1      64 deny ip from any to any 
    

    Once I removed that firewall rule with:

    sudo ipfw delete 00411
    

    I was able to talk to Docker from the OS X command shell.

提交回复
热议问题