Before we follow the build-ship-run steps, we need to install Docker on our machine. On Linux, we use the classic installation method, Docker Community Edition (CE or Docker-CE):
$ curl -sSL https://get.docker.com | sudo bash
Throughout the book, we will use a Debian or Ubuntu machine to demonstrate Docker. On a Debian/Ubuntu machine, we will get the most stable version of Docker (at the time of writing) via apt-get Docker back to version 17.06.2. If we already have a newer version of Docker, such as 17.12 or 18.03, it will be downgraded to 17.06.2:
$ sudo apt-get install docker-ce=17.06.2~ce-0~ubuntu
For macOS and Windows systems, we can download Docker from the Docker website:
- Docker for Mac: https://www.docker.com/docker-mac
- Docker for Windows: https://www.docker.com/docker-windows
To check the installed version of Docker, we can use the docker version command:
$ docker version
Client:
Version: 17.06.2-ce
API version: 1.30
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 20:00:33 2017
OS/Arch: linux/amd64
Server:
Version: 17.06.2-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:59:26 2017
OS/Arch: linux/amd64
Experimental: true
The information printed out from the docker version is separated into two sections, client and server. The client section tells us information about the docker binary used to issue commands. The server section tells us the version of dockerd, the Docker Engine.
What we can see from the previous snippet is that both client and server are of version 17.06.2-ce, the second update of the stable 17.06 Community Edition. The server allows Docker client 1.12 as the minimum version to connect to. The API version tells us that dockerd implements remote API version 1.30.
If we expect to use the next stable version of Docker, we should go for the upcoming 17.06.3, 17.09.x, or 17.12.x versions.