Ismael Rivera
Ismael Rivera

Reputation: 95

My boot2docker installation seems to not be working. What am I doing wrong?

I'm running on Mac OS X 10.6.8 Snow Leopard. FYI: I can't upgrade my OS so that is not an option for me right now.

So, I install boot2docker and when I go click on the icon I receive the following output:

username@My-Mac:~$ bash
username@My-Mac:~$ unset DYLD_LIBRARY_PATH ; unset LD_LIBRARY_PATH
username@My-Mac:~$ mkdir -p ~/.boot2docker
username@My-Mac:~$ if [ ! -f ~/.boot2docker/boot2docker.iso ]; then cp    /usr/local/share/boot2docker/boot2docker.iso ~/.boot2docker/ ; fi
username@My-Mac:~$ /usr/local/bin/boot2docker init 
/usr/local/bin/boot2docker up 
$(/usr/local/bin/boot2docker shellinit)
docker version
error in run: Failed to initialize machine "boot2docker-vm": exit status 1
username@My-Mac:~$ /usr/local/bin/boot2docker up 
error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)
username@My-Mac:~$ $(/usr/local/bin/boot2docker shellinit)
error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)
username@My-Mac:~$ docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): darwin/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 
username@My-Mac:~$ 

What does this mean? How can I fix this?

Upvotes: 2

Views: 1957

Answers (3)

Ismael Rivera
Ismael Rivera

Reputation: 95

After much hassle and delegation I was able to finally figure out what was going on. It was xanderlopez in this post that got me to realize that the problem lied with my shared folder and virtual machine folder locations for VitualBox. After changing the shared folder and renaming the location for the VM to "VirtualBox VMs", once I reinstalled boot2docker, everything ran as was supposed to and the hello world verification succeeded. So that's a gotcha right there. The location of your vm must be inside a folder named "VirtualBox VMs". The location seems to be unimportant as I just created a subfolder folder inside the folder that I was already using. Not sure how that works but it seems to have worked which is good enough for this issue. If I see any problems up ahead later related to the folder structure I'll be sure to reference this post.

Upvotes: 1

Greg
Greg

Reputation: 6759

The answer above is correct, but you don't need the eval, you can just use:

$(boot2docker shellinit)

You can put this in your .profile

echo '$(boot2docker shellinit)' >> ~/.profile

and then it is setup every time you create a new shell.

This might be a duplicate of a previous question I answered:

Docker TLS error on Mac

Upvotes: 2

bacrossland
bacrossland

Reputation: 145

I ran into the same issue. You need to set the environment variables in your shell. Run the following:

eval "$(boot2docker shellinit)"

Since it is only persistent per shell you'll need to add it to your ~/.bashrc, ~/.bash_profile, .zshrc, or whatever other shell profile you need it to run in.

Here is a good example of a plist for auto starting boot2docker. You'll have to modify the plist so the working directory matches yours. https://gist.github.com/krak3n/0f7fe4c3c5828767ec5b

I've installed Kitematic (Version 0.5.19 which is Beta as of this writing) as well as boot2docker on my system. Kitematic does not install a plist for auto starting your boot2docker instance. It boots when you start Kitematic. It most likely shuts it down on close which means your containers that are running will shutdown as well.

Ultimately it is up to how you want to setup and run your environment. If you're going only boot2docker and docker CLI and want things running at boot, create the plist and set your .bash_profile/.zshrc. If you want a GUI and CLI option that only boots and runs when you want it to then Kitematic is the way to go.

Upvotes: 2

Related Questions