Getting Started with Docker Toolbox and Compose

Nov 16 2015

Today at DockerCon EU 2015, I ran through a demo of running and developing an app from a fresh computer using Docker Toolbox and Compose. This was to show how easy it is for new developers to get started when you run your development environments with Docker.

The demo showed an app that has:

• A Python webapp which lets you vote between two options
• A Redis queue which collects new votes
• A Java worker which consumes votes and stores them in…
• …A Postgres database backed by a Docker volume
• A Node.js webapp which shows the results of the voting in real time

Docker-toolbox In the demo I created and ran the containers using Docker Compose, which installs as part of Docker Toolbox, and is now available for the first time on Windows. I then used Kitematic to examine the running app, and showed how I can quickly make changes to it.

Here are the steps to reproduce the demo:

To get started, first download and install Docker Toolbox.

The Toolbox installer will install VirtualBox, Docker Engine, Docker Machine, Docker Compose and Kitematic.

It will place two shortcuts on your desktop: Kitematic and Docker Quickstart Terminal.

Open Docker Quickstart Terminal. It will create and start a VirtualBox VM running Docker Engine, then configure the command-line environment so that you can talk to it. When it’s finished, you will see an ASCII-art whale and a command prompt.


Run the following command and press Enter to download the source code for the demo app:

git clone

Next, enter the directory where the app’s source code lives:

cd example-voting-app/voting-apps

Start the app with Docker Compose:

docker-compose --x-networking up

This will take some time. Docker Compose will pull all the images it needs from the Docker Hub, build the images for the voting app, results app and worker, create all five containers and finally stream their output to the terminal.

To see the containers running, open Kitematic. You should see the five containers running in the left-hand column.


Click on voteapps_voting-app_1. Kitematic will show its logs, as well as a web preview.

Click the arrow button above the web preview to open the voting app in a browser.


You’ll be able to vote for either cats or dogs. Cast your vote!

Next, return to Kitematic, click on voteapps_result-app_1, and open it in the browser just as you did with the voting app. You should see your vote reflected by a 100% turnout.

Now that the app is running, it’s worth having a look at the code. Navigate to the directory where the app lives (you’ll find it in your home directory under example-voting-app) and open docker-compose.yml. You’ll see that it defines five services, using either images straight from the Docker Hub or build directories containing Dockerfiles. You can also browse the code for the Python voting app, Java worker and Node.js results app.

Note that in docker-compose.yml, the voting-app and result-app services mount their code inside the containers as volumes. This makes it really easy to make incremental changes to those apps and see the results immediately when you refresh the browser.


To try this out, open up in the voting-app directory and change the voting candidates to something other than “Cats” and “Dogs” – for example, “Star Trek” and “Star Wars”.

Image11 Image04








You can also make the same change in result-app, by editing index.html under views.

Save both files, then refresh both browser tabs. You’ll see that the apps have updated.

Image06 Image09









There you have it: you’ve gone from zero to a live development environment, running a complex multi-container application using Python, Redis, Java, Postgres and Node.js without having to install any of them on your computer.

Stop the app

To shut the app down, go back to the Quickstart Terminal where you launched the app and press Ctrl-C to stop the containers. You can then either remove them one-by-one in Kitematic, or with a single command in the terminal:
docker-compose rm -f

Learn more

If you want to learn more about Docker Toolbox and Docker Compose, check out the Docker documentation. And if you need any help, you can post in our support forums, or post a question on StackOverflow.


Learn More about Docker



4 thoughts on "Getting Started with Docker Toolbox and Compose"

DockerCon 2022

With over 50 sessions for developers by developers, watch the latest developer news, trends, and announcements from DockerCon 2022. From the keynote to product demos to technical breakout sessions, hacks, and tips & tricks, there’s something for everyone.

Watch Now