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 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:
1
2
3
4
5
6
7
8
|
> 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:
1
2
3
|
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
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:
1
2
3
4
5
6
7
|
~> 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:
1
2
3
|
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:
- Docker Client 1.8.0 (for Mac)
- Docker Compose 1.4.0
- Docker Machine 0.4.0
- VirtualBox 5.0.0
Upgrade Docker CLI:
1
2
3
4
|
curl https://get.docker.com/builds/Darwin/x86_64/docker-latest > /usr/local/bin/docker
chmod +x /usr/local/bin/docker
|
Upgrade Docker Machine:
1
2
3
4
|
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:
1
2
3
4
|
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
~> 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"
|
So start an existing machine as:
1
2
3
|
docker-machine start lab
|
And then upgrade it as:
1
2
3
4
5
6
7
8
|
~> 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.
Have you been able to get bash auto-complete to work with Docker Toolbox?
Richard,
I’ve not tried it yet. Does it not work?
How can i Install java in docker tool box for windows??
It is best toolbox and endearing in look.