DevOps

Docker Toolbox

One of the new features introduced in Docker 1.8 is Docker Toolbox. What is this 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

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.

docker-toolbox-logo This flow needs to be slightly cleaned up (#63).

Read more details in DockerToolbox blog.

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?

Reference: Docker Toolbox from our JCG partner Arun Gupta at the Miles to go 2.0 … blog.

Arun Gupta

Arun is a technology enthusiast, avid runner, author of a best-selling book, globe trotter, a community guy, Java Champion, JavaOne Rockstar, JUG Leader, Minecraft Modder, Devoxx4Kids-er, and a Red Hatter.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
Back to top button