Search code examples
macosdockerboot2dockerunix-socketkubernetes

Boot2Docker searching for docker-bootstrap.sock which does not exist


I am currently trying to set up kubernetes on a multi-docker container on CoreOS stack for AWS. To do this I need to set up etcd for flannel and am currently using this guide but am having problems at the first stage where I am suggested to run

sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'

The problem is the 1st command

 docker -d -H unix:///var/run/docker-bootstrap.sock

from within boot2docker. There is no docker-bootstrap.sock file in this directory and this error is thrown:

FATA[0000] An error occurred trying to connect: Post https:///var/run/docker-bootstrap.sock/v1.18/containers/create: dial unix /var/run/docker-bootstrap.sock: no such file or directory

Clearly the unix socket did not connect to this nonexistent socket.

I will note this is a very similar problem to this ticket and other tickets regarding the FATA[0000] though none seem to have asked the question in the way I currently am.

I am not an expert in unix sockets, but I am assuming there should be a file where there is not. Where can I get this file to solve my issue, or what is the recommended steps to resolve this.

specs: running OSX Yosemite but calling all commands from boot2docker


Solution

  • Docker should create this file for you. Are you running this command on your OS X machine? or are you running it inside the boot2docker VM?

    I think you need to:

    boot2docker ssh
    

    Then:

    sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
    

    You need to make sure that command runs on the Vagrant Linux box that boot2docker creates, not your OS X machine.

    Hope that helps!