Docker Toolbox

Posted by: Arun Gupta on August 12, 2015

One of the new features introduced in Docker 1.8 is Docker Toolbox. What is this toolbox?

Docker Toolbox

The Docker Toolbox is an installer to quickly and easily install and setup a Docker environment on your computer. Available for both Windows and Mac, the Toolbox installs Docker Client, Machine, Compose (Mac only), Kitematic and VirtualBox.

Docker Toolbox is the fastest way to get up and running with Docker in development. In short, it provides the different tools required to get started with Docker:

  • Docker Client docker binary
  • Docker Machine docker-machine binary
  • Docker Compose docker-compose binary
  • Kitematic – Desktop GUI for Docker
  • Docker Quickstart Terminal app

If you have Docker CLI, Machine, Compose, and other tools installed in the /usr/local/bin directory then this would just overwrite them.

Specifically, Docker Toolbox 1.8.0a installs:

  • Docker Client 1.8.0
  • Docker Machine 0.4.0
  • Docker Compose 1.4.0
  • Docker Quickstart Terminal App
  • Kitematic 0.8.1
  • Virtual 5.0.0

After the installation completes, the versions are shown as:

> docker -v
Docker version 1.8.0, build 0d03096
> docker-compose -v
docker-compose version: 1.4.0
> docker-machine -v
docker-machine version 0.4.0 (9d0dc7a)

If an older version of VirtualBox is already running then it will show a message as shown:

The installer has detected that VirtualBox is out of date, and is still running. Please shut down all VMs, quit VirtualBox, and then restart the Docker Toolbox installation.

This flow needs to be slightly cleaned up (#63).

Read more details in DockerToolbox blog.

UPDATE: Virtual Box 5.0.0 prohibits Kubernetes cluster from starting. Not sure if Docker 1.8.0 will work with Virtual Box 4.3.30 but I downgraded VirtualBox 5.0.0 to 4.3.30 and also downgraded Docker 1.8.0 to 1.7.0 as explained in #12614.

Docker Quickstart Terminal

It also created a new Docker category in Applications with links to Docker Quickstart Terminal and Kitematic. Clicking on the terminal app creates a default Machine instance and shows the following output:

Creating Machine default...
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env default
Starting machine default...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
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

The configured Docker environment variables are:

~> env | grep DOCKER
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_MACHINE_NAME=default
DOCKER_TLS_VERIFY=1
DOCKER_CERT_PATH=/Users/arungupta/.docker/machine/machines/default

VirtualBox is also updated to 5.0.0 r101573.

The Quickstart Terminal is mostly a regular shell but allows to create a default machine. It can be used to connect to other machines as well:

eval $(docker-machine env <MACHINE_NAME>)

Update existing Docker scripts to Docker 1.8

If you’d like to update existing Docker scripts to 1.8, then they are available at:

Upgrade Docker CLI:

curl https://get.docker.com/builds/Darwin/x86_64/docker-latest > /usr/local/bin/docker
chmod +x /usr/local/bin/docker

Upgrade Docker Machine:

curl -L https://github.com/docker/compose/releases/download/1.4.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Upgrade Docker Compose:

curl -L https://github.com/docker/machine/releases/download/v0.4.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
chmod +x /usr/local/bin/docker-machine

Virtual Box needs can be downloaded from virtualbox.org.

Upgrade Docker VMs

Docker version of existing Machines can be found as:

~> docker-machine ssh lab cat /etc/os-release
NAME=Boot2Docker
VERSION=1.7.0
ID=boot2docker
ID_LIKE=tcl
VERSION_ID=1.7.0
PRETTY_NAME="Boot2Docker 1.7.0 (TCL 6.3); master : 7960f90 - Thu Jun 18 18:31:45 UTC 2015"
ANSI_COLOR="1;34"
HOME_URL="http://boot2docker.io"
SUPPORT_URL="https://github.com/boot2docker/boot2docker"
BUG_REPORT_URL="https://github.com/boot2docker/boot2docker/issues"

This can only be done after the machine is running though.

So start an existing machine as:

docker-machine start lab

And then upgrade it as:

~> docker-machine upgrade lab
Stopping machine to do the upgrade...
Upgrading machine lab...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.8.0/boot2docker.iso to /Users/arungupta/.docker/machine/cache/boot2docker.iso...
Starting machine back up...
Starting VM...

Java Applications using Docker

Ready to start deploying your Java applications to Docker?

Get started with github.com/javaee-samples/docker-java.

The post Docker Toolbox appeared first on Miles to go 3.0 ....

Arun Gupta

About Arun Gupta

Arun Gupta is Director of Developer Advocacy at Red Hat and focuses on JBoss Middleware. As a founding member of the Java EE team at Sun Microsystems, he spread the love for technology all around the world. At Oracle, he led a cross-functional team to drive the global launch of the Java EE 7 platform through strategy, planning, and execution of content, marketing campaigns, and program. He is a prolific blogger since 2005 and have authored 1500+ blogs on technology. Arun has extensive speaking experience in ~40 countries on myriad topics and is a JavaOne Rockstar. He also founded the Devoxx4Kids chapter in the USA and continues to promoting technology education amongst kids. An author of a best-selling book, an avid runner, a globe trotter, a Java Champion, JUG leader, he is easily accessible at @arungupta.