Getting started with Swarm

We'll now proceed with the installation of two small Swarm v1 and v2 proof of concept clusters, the first on local and the second on Digital Ocean. In order to execute the recipes, check the list of ingredients, ensure that you have everything, and then begin.

To follow the example, you'll need:

  • Either a Windows, Mac OS X, or Linux desktop
  • A Bash or Bash-compatible shell. On Windows you can either useCygwin or Git Bash.
  • The latest version of VirtualBox, installed for the local example
  • At least 4GB of memory for 4 VirtualBox instances of 1G of memory each for the local example
  • A Docker client, at least version 1.6.0 for Swarm v1 and 1.12 for Swarm v2
  • The latest version of Docker Machine, which is currently 0.8.1

Docker for Mac

Docker announced the desktop version of Docker for Mac and Docker for Windows early in 2016. It's better than the Docker Toolbox, since it includes the Docker CLI tools you expect but doesn't use boot2docker and VirtualBox anymore (it uses unikernels instead, which we'll introduce in Chapter 11, What is Next?) and it's fully integrated into the operating system (Mac OS X Sierra or Windows 10 with Hyper-V enabled).

You can download the Docker desktop from https://www.docker.com/products/overview#/install_the_platform and install it easily.

Docker for Mac

Just drag and drop the Docker beta icon to your applications folder if you're using Mac OS X. Input your beta registration code, if any, and it's done.

Docker for Mac

On OS X, you will have the Docker whale in the system tray, which you can open and also configure your settings. A Docker host will be running natively on your desktop.

Docker for Mac

Docker for Windows

In the case of Docker for Windows, it requires Windows 10 with Hyper-V enabled. Basically, Hyper-V comes with Windows 10 Professional or higher versions. After double-clicking on the setup program, you'll see that the first screen, showing the License Agreement, looks similar to the following screenshot. The setup program will request you for a key similar to that of Docker for Mac.

Docker for Windows

If the installation process goes smoothly, you will see that the finish screen is ready for you to launch Docker for Windows, as shown:

Docker for Windows

At the time of launch, Docker will initialize itself to the Hyper-V. Once the process is done, you can just open PowerShell and start using Docker.

Docker for Windows

If something goes wrong you can open the logging Windows from the tray icon's menu, as well as check with Hyper-V Manager.

Docker for Windows

Getting ready with Linux

We'll extensively use Machine in this book, so ensure that you have it installed through Docker for Mac or Windows or Docker Toolbox. If you use Linux on your desktop, install the Docker client with your package system (apt or rpm). You will also have to download the bare machine binary, just curl it and assign it the execution permissions; follow the instructions at https://docs.docker.com/machine/install-machine/. The current stable version is 0.8.1.

$ curl -L 
https://github.com/docker/machine/releases/download/v0.8.1/docker-
machine-uname -s-uname -m > /usr/local/bin/docker-machine
$ chmod +x /usr/local/bin/docker-machine`

Check that Docker Machine is available - all systems

You can check that the machine is ready to be used with the following command from the command line:

$ docker-machine --version
docker-machine version 0.8.1, build 41b3b25

If you have problems, please control the system paths or download the correct binary for your architecture.

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

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