Docker provides several tools that extend the functionality outside of the core Docker engine. In this chapter, you will walk-through installing, configuring, and running the following tools:
These tools, while not as functional as some of the more advanced ones that we will be working with in the upcoming chapters, will serve as a good introduction to both adding additional functionality to core Docker engine as well as concepts for deploying and orchestrating your containers, which we will be doing more of towards the end of the book.
Before we start to look at how to use the three other tools, we should look at installing them on our local machine. In the previous chapter, we downloaded a script supplied by Docker and piped it through bash to quickly configure the official Docker YUM or APT repository (depending on the operating system you are running) on an already provisioned server, the command we executed was as follows:
curl -sSL https://get.docker.com/ | sh
This is useful if you already have a Linux-based server up and running on one of the many cloud services or locally on virtual machine; however, what if you want to install Docker on a non-Linux operating system such as Mac OSX or Windows?
Always check the source. It is best practice to check the source of the bash script that you are going to be downloading and installing; in our case, you can check this by going to https://get.docker.com/ in your browser.
Before we look at the tools that Docker provides to do just that, we should answer the question why?
So, why would we want to install Docker Toolbox, Compose, Machine, and Swarm on a non-Linux machine? Well, to start with, you need to remember that Docker, at its core, is an API to Linux Kernel-based technologies, such as run (https://github.com/opencontainers/runc) and LXC (https://linuxcontainers.org), so while you will not be able to launch containers on your Mac OS X or Windows machine, you will be able to interact with a Docker installation on a Linux machine.
Being able to interact with Docker from your local machine means that you launch and interact with containers across multiple hosts that can be hosted externally on a public cloud/hosting service or locally on a virtual machine.
Luckily, Docker has you covered for installing Docker and the three other services that we are going to be looking at in this chapter on your local machine.
Docker provides a global installer for all of their tools called Docker Toolbox, it makes installing the following software as painless as possible:
To get started, you will need to be running a machine that either has Mac OS X 10.8+ or has Windows 7+ installed. In my case, I am running Mac OS X 10.11 (El Capitan); there is very little difference between the Mac OS X and Windows installers:
The first screen is a welcome page that confirms the version of the toolbox you are running. If you downloaded from the page in the preceding screenshot, then you will always have the latest version:
This information is useful in giving Docker an idea about the types of machine their software is being installed on, and also it will report back any errors that you may encounter when running the installer:
I always recommend keeping this box ticked, as it all goes toward Docker making a better product and improving the experience of future versions of the installer.
As I want to install all of the tools, I have chosen to go with the standard installation:
As running the installer also acts as an upgrader for any components you have installed, it will run a check to see if any of the files managed by the services (such as the virtual machine images used by the various tools) need to be updated.
Depending on the size of any updates and how much data you have, this process can take several minutes.
This process only applies to updates, so if you have performed a fresh installation like I have done, this section will be skipped.
Now, you have all of the tools installed on your local machine to continue with the rest of the chapter and the book.
Before we start to look at the individual tools, we need to configure the Docker agent. To do this, run the Docker Quickstart Terminal application. If you have multiple terminal emulators installed, it will pop up a prompt asking you which one you would like to use; I prefer to use the one that ships with Mac OS X, so I chose Terminal.
Once you have made your selection, a new terminal window will open and the application will configure your local installation of Docker for you:
In my case, I got the preceding terminal output when launching the Docker Quickstart Terminal application.