Chapter 2. Introducing First-party Tools

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:

  • Docker Toolbox
  • Docker Machine
  • Docker Swarm
  • Docker Compose

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.

Docker Toolbox

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?

Tip

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?

Why install Docker locally?

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.

Installing Docker Toolbox

Docker provides a global installer for all of their tools called Docker Toolbox, it makes installing the following software as painless as possible:

  • Docker Client
  • Docker Machine
  • Docker Compose
  • Docker Kitematic
  • VM VirtualBox

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:

  1. First of all, to get started, you will need to download the installer from the Docker website. You can find links to download an executable for your chosen operating system at https://www.docker.com/docker-toolbox/.
    Installing Docker Toolbox
  2. Once you have downloaded the installer, you can launch it by double-clicking on it. You will then be presented by a series of screens and install options.

    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:

    Installing Docker Toolbox
  3. To move to the next step of the installation, click on Continue.
  4. The next screen goes into more detail about the packages that will be installed, as well as the location at which they will be installed. There is also a box, which, if left ticked, will gather data about the machine you are installing Docker Toolbox on, anonymize it, and then submit it back to Docker.

    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:

    Installing Docker Toolbox

    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.

  5. To progress to the next step of the installation, click on Continue.
  6. The next screen will give you the option of which disk you would like to install the various tools on. In most cases, you should stick with the defaults, unless you are running applications across multiple drives:
    Installing Docker Toolbox
  7. To move on to the next step of the installation, again click on the Continue button.
  8. For majority of the people, a standard installation will be enough; however, if its not to install one of the tools, you can click the Customize button. The only two tools you have to install are the Docker Client and Docker Machine.

    As I want to install all of the tools, I have chosen to go with the standard installation:

    Installing Docker Toolbox
  9. Once you have chosen either a standard or custom installation, you can perform the installation by clicking the Install button.
  10. The installation itself takes a few minutes, during which you will get feedback on the task the installer is running:
    Installing Docker Toolbox
  11. Once the installation is complete, click on the Continue button.

    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.

  12. Now that the tools have been installed, you will be given the options of launching either the Docker Quickstart Terminal or Kitematic. For the purpose of this book, we will be skipping past this screen by clicking on the Continue button:
    Installing Docker Toolbox
  13. If everything has gone as planned, you will see a message confirming that the installation has been completed and you can click on the Close button to quit the installer:
    Installing Docker Toolbox

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:

Installing Docker Toolbox

In my case, I got the preceding terminal output when launching the Docker Quickstart Terminal application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset