Docker Community Forums

Share and learn in the Docker community.

Why is Docker Toolkit install failing on Mac OSX?


(Architectscott) #1

I downloaded the latest Docker Toolkit - the one that has deprecated boot2docker - I have tried to use both the Docker Quickstart Terminal and Kitematic to initialize VirtualBox – in both cases – the configuration proceeds up to a point and then it just hangs. Kitematic comes back with an error and tells me to redo the virtual machine install and the QS Terminal just hangs as it tries to start the virtual machine. I actually think the problem is Virtual Box – nothing like an unsupported virtualization solution from Oracle ;-( – so at wits end – I may just have to use Fusion and install an Ubuntu version – but thought I would see if anyone has this solved.


Most frustrating experience with Docker on OS X
(Ralph Kincade) #2

I am running Windows 7 Ultimate version 6.1 vuild 7601 service pack 1 and
Oracle VM virtual box 5.0.2, this was installed 6 months ago

I installed the docker tool box about a month ago and it is version 1.8.1b

this is the result of “docker version” on my docker tool box

                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

Welcome to Git (version 1.9.5-preview20150319)

Run ‘git help git’ to display the help index.
Run 'git help ’ to display help for specific commands.

3333@AE2D436Q1 ~
$ docker version
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: windows/amd64

Server:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built: Thu Aug 13 02:49:29 UTC 2015
OS/Arch: linux/amd64

44444@AE-F2D344446Q1 ~
$


(Jeff Anderson) #3

What happens if you open the virtualbox gui and try to launch the machine directly? Sometimes you can see errors in the GUI window that are hard to detect with automation.


(Architectscott) #4

Good idea Jeff - so I stopped the vbox instance - restarted it and it seems to be working … but the mac tools e.g. terminal and kitematic are still hosed – QA issue at docker I guess :wink:

thanks!!


(Architectscott) #5

So I think it must be a port issue for VirtualBox - when I try to launch Kitematic, it gets to 99% and it just hangs … I am giving up – it is baffling to me that no one else has seen this problem …

I guess I will just throw VBox away and use Fusion (which is much better ;-)) and just install Ubuntu on it and work on a VM – really unfortunate that the Mac support for docker is so weak.


(Architectscott) #6

Here is the error that I get from Kitematic -

/Applications/Docker/Kitematic (Beta).app/Contents/Resources/resources/docker-machine -D create -d virtualbox --virtualbox-memory 2048 default returned non zero exit code. Stderr: Converting from raw image file=“stdin” to file="/Users//.docker/machine/machines/default/disk.vmdk"… Creating dynamic image with size 20971520000 bytes (20000MB)… Error creating machine: Maximum number of retries (60) exceeded You will want to check the provider to make sure the machine and associated resources were properly removed.


(Architectscott) #7

So - here is what I cannot get around …
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""_/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
_
___ o /
\ \ /
_
_
_____/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

open /Users/scottsimmons/.docker/machine/machines/default/ca.pem: no such file or directory
bash-3.2$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default virtualbox Running tcp://192.168.99.100:2376
bash-3.2$ docker run apache
Post http:///var/run/docker.sock/v1.20/containers/create: dial unix /var/run/docker.sock: no such file or directory.

  • Are you trying to connect to a TLS-enabled daemon without TLS?
  • Is your docker daemon up and running?
    bash-3.2$

This is really aggravating …


(Jeff Anderson) #8

Sorry for the long reply, I’m just trying to brain dump my analysis of the situation to help get you some context as to what might be happening.

Okay, on first invocation, kitematic/the quickstart terminal does the following things:

runs docker-machine create default with the right options to get a virtualbox machine up and running, importing any legacy boot2docker machines you might have created with the now-deprecated boot2docker cli.

That boils down to more-or-less the following steps:

  • virtualbox machine is created (this seems to be working more-or-less since you have the default machine in your vbox list, but you did paste an error message related to importing the boot2docker disk)
  • waits for ssh to become available (unsure whether this is happening, probably not due to the error on the disk import thing)
  • generates certificates on the boot2docker VM, generates a client certificate, and installs it to ~/.docker/machine/machines/default/ (this is definitely not happening since you are getting the file not found issue)

On subsequent invocations, it won’t try to do the create if the machine already exists, even if it didn’t complete 100%. It will try to populate this shell’s environment with the right pieces of config for your docker client to talk to the docker daemon. It runs basically the following:

eval $(docker-machine env default)

This is the command that is erroring out with the “open /Users/scottsimmons/.docker/machine/machines/default/ca.pem: no such file or directory” message

Hopefully that sheds some light on what is going on.


The next thing to try will be to open a new terminal (doesn’t have to be the quickstart terminal, a normal one is fine). Do you have an existing boot2docker-vm sitting in your virtualbox? My hypothesis that the docker-machine create is failing because of the boot2docker import can be testing by trying to make a machine without doing that import:

docker-machine create -d virtualbox --virtualbox-memory 2048 testing

Does that complete successfully? what output does it give you?

Assuming it does work correctly, you should be able to run the following command:

docker-machine env testing

This should output some shell exports, and should not output any errors. Here’s what it looks like on my system:

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.101:2376"
export DOCKER_CERT_PATH="/Users/jefferya/.docker/machine/machines/testing"
export DOCKER_MACHINE_NAME="testing"
# Run this command to configure your shell:
# eval "$(docker-machine env testing)"

Now, to actually activate this in your shell, run:

eval "$(docker-machine env testing)"

At this point, you should be able to use docker in that shell.

If all has gone well with the testing machine, then you can remove it:

docker-machine rm -f testing

The next thing you can try is to repeat the docker-machine create again, but include the boot2docker vm import stuff:

docker-machine create -d virtualbox --virtualbox-memory 2048 --virtualbox-import-boot2docker-vm boot2docker-vm testing

Does this fail at all? It might give a different/better error message or return code.


Probably the easiest way to get you up and running will be to manually create a ‘default’ machine that kitematic or the quickstart terminal will use:

docker-machine rm -f default # get rid of the old broken one
docker-machine create -d virtualbox --virtualbox-memory 2048 default

If this works, you should be able to use it in the quickstart terminal, or from kitematic on their subsequent invocations.

If it turns out that it was your boot2docker-vm import that was causing the trouble, then it might be worth filing a bug report with the docker-machine project. I’m not 100% sure how you’d document a repeatable event like you have without making available your whole disk image.

/Jeff


(Architectscott) #9

Jeff - So I will work on this either tomorrow or Saturday – your points seem spot on … I will get back to you in the next few days when I have a chance to work on this again – thanks much for the great explanation and your assistance … want to get Docker-smart and seem to be running into some issues :wink:


(Jeff Anderson) #10

For reference, here is the script that the quickstart terminal runs when you launch it:


(Architectscott) #11

HI Jeff = so it creates the testing instance – but … when I try to run the env testing …

===========

Scotts-MacBook-Pro:~ scottsimmons$ docker-machine env testing
open /Users/scottsimmons/.docker/machine/machines/testing/ca.pem: no such file or directory

This seems to be the crux of the problem …


(Chairmanp) #12

Hi Scott,
If this is the same Scott who worked for Extricity many moons ago, hello! This is Ron P. Hope you are well!

I had a similar problem, and worked around the problem by starting Oracle VirtualBox, stopping the VMs (I had some older ones created by older versions of Docker), and then removing them (command R) in the UI. Then when I started Docker Quickstart Terminal, it ran normally:

Creating Machine default…
Running pre-create checks…
Creating machine…
(default) Creating VirtualBox VM…
(default) Creating SSH key…
(default) Starting VM…
Waiting for machine to be running, this may take a few minutes…
Machine is running, waiting for SSH to be available…
Detecting operating system of created instance…
Detecting the provisioner…
Provisioning with boot2docker…
Copying certs to the local machine directory…
Copying certs to the remote machine…
Setting Docker configuration on the remote daemon…
Checking connection to Docker…
Docker is up and running!
To see how to connect Docker to this machine, run: /usr/local/bin/docker-machine env default
Setting environment variables for machine default…

                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

oakm031516531:~ rpark$