Docker Community Forums

Share and learn in the Docker community.

Support for virtualbox docker-machine?


(Patrick O'Connor) #1
➜  for i in {0..2};do docker-machine create  --driver virtualbox --virtualbox-memory "2048" ducp-${i};done
Running pre-create checks...
Creating machine...
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...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
To see how to connect Docker to this machine, run: docker-machine env ducp-0
Running pre-create checks...
Creating machine...
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...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
To see how to connect Docker to this machine, run: docker-machine env ducp-1
Running pre-create checks...
Creating machine...
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...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
To see how to connect Docker to this machine, run: docker-machine env ducp-2
➜  docker-machine ls
NAME     ACTIVE   DRIVER       STATE     URL                         SWARM
dev      *        virtualbox   Running   tcp://192.168.99.100:2376
ducp-0   -        virtualbox   Running   tcp://192.168.99.105:2376
ducp-1   -        virtualbox   Running   tcp://192.168.99.106:2376
ducp-2   -        virtualbox   Running   tcp://192.168.99.107:2376
➜ docker-machine ssh ducp-0
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.9.0, build master : 16e4a2a - Tue Nov  3 19:49:22 UTC 2015
Docker version 1.9.0, build 76d6bc9
docker@ducp-0:~$ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --name ucp dockerorca/ucp install -i
Unable to find image 'dockerorca/ucp:latest' locally
latest: Pulling from dockerorca/ucp
f08f7de64c4e: Pull complete
87a6bbaf1f90: Pull complete
Digest: sha256:ed7e723c1a42d0b09b3b7e2743dd61543140363c6aa18c5ea9856fca823f3be8
Status: Downloaded newer image for dockerorca/ucp:latest
INFO[0000] Verifying your system is compatible with UCP
Please choose your initial Orca admin password:
Confirm your initial password:
INFO[0003] Pulling required images
Please enter your Docker Hub username: myuser
Please enter your Docker Hub password:
Please enter your Docker Hub e-mail address: email@mydomain.com
INFO[0016] Pulling required images
WARN[0052] None of the hostnames we'll be using in the UCP certificates [ducp-0 127.0.0.1 172.17.0.1 10.0.2.15] contain a domain component.  Your generated certs may fail TLS validation unless you only use one of these shortnames or IPs to connect.  You can use the --san flag to add more aliases

You may enter additional aliases (SANs) now or press enter to proceed with the above list.
Additional aliases: ducp-0.domain.local 192.168.99.105
INFO[0085] Installing UCP with host address 10.0.2.15 - If this is incorrect, please use the '--host-address' flag to specify a different address
FATA[0002] The following required ports are already in use on your host - [2376].  The default port for the Swarm manager is 2376, but you already have something listening on that port.  You may specify an alternative port number with the --swarm-port argument.

(Anoop) #2

What is the question or help needed here?


(Artworkad) #3

the question is how to setup ucp with docker-machine. UCP tries to spin up swarm but it is already running in docker-machine.


(Vivek Saraswat) #4

If port 2376 is in use due to docker-machine, you can use --swarm-port <port#> to use a different port. I tend to use 42376 as an example when I am running in VMs on my laptop.


(Artworkad) #6

It is working for me using this command:

docker run --rm -it \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -e REGISTRY_USERNAME=${REGISTRY_USERNAME} \
 -e REGISTRY_PASSWORD=${REGISTRY_PASSWORD} \
 -e REGISTRY_EMAIL=${REGISTRY_EMAIL} \
 --name ucp \
 dockerorca/ucp install \
 --fresh-install \
 --san 192.168.100.10 \
 --host-address 192.168.100.10

You need to change san and host-address to the address of your VM.

When joining cluster:

docker run --rm -it \
 --name ucp \
 -e UCP_ADMIN_USER=admin \
 -e UCP_ADMIN_PASSWORD=orca \
 -e REGISTRY_USERNAME=${REGISTRY_USERNAME} \
 -e REGISTRY_PASSWORD=${REGISTRY_PASSWORD} \
 -e REGISTRY_EMAIL=${REGISTRY_EMAIL} \
 -v /var/run/docker.sock:/var/run/docker.sock \
 dockerorca/ucp join \
 --url https://192.168.100.10:443 \
 --san 192.168.100.11 \
 --host-address 192.168.100.11 \
 --fingerprint=<SHA1:CERT:FINGERPRINT>

url is the ip of your swarm manager. Again change san and host address to the ip of the VM node. You can optain the fingerprint from the log of your first node.