Installing Docker for Mac

Navigate to the following link to download Docker for Mac at https://docs.docker.com/docker-for-mac/install/.

There is a stable version and a so-called edge version of the tool available. In this book, we are going to use some newer features and Kubernetes, which at the time of writing are only available in the edge version. Thus, please select this version.

To start the installation, click on the Get Docker for Mac (Edge) button and follow the instructions.

Once you have successfully installed Docker for Mac, please open a Terminal. Press command spacebar to open Spotlight and type terminal, then hit Enter. The Apple Terminal will open as follows:

Apple Terminal window

Type docker --version in the Command Prompt and hit Enter. If Docker for Mac is correctly installed, you should get an output similar to the following:

$ docker --version
Docker version 18.02.0-ce-rc2, build f968a2c

To see whether you can run containers, enter the following command into the Terminal and hit Enter:

$ docker run hello-world

If all goes well, your output should look something like the following:

Running the Hello World container on Docker for Mac

Congratulations, you are now ready to work with Docker containers.