Understanding the Docker setup
It is important to understand the Docker components and their versions, storage, and the execution drivers, the file locations, and so on. Incidentally, the quest for understanding the Docker setup will also reveal whether the installation was successful or not. You can accomplish this using two Docker subcommands: docker version
and docker info
.
Let's start our Docker journey with the docker version
subcommand, as shown here:
$ sudo docker version Client: Version: 17.03.0-ce API version: 1.26 Go version: go1.7.5 Git commit: 60ccb22 Built: Thu Feb 23 10:57:47 2017 OS/Arch: linux/amd64 Server: Version: 17.03.0-ce API version: 1.26 (minimum version 1.12) Go version: go1.7.5 Git commit: 60ccb22 Built: Thu Feb 23 10:57:47 2017 OS/Arch: linux/amd64 Experimental: false
Although the docker version
subcommand lists many lines of text, as a Docker user you should know what these following output lines mean:
- The client version
- The client API version
- The server version
- The server API version
Here, both the client and server are of community edition 17.03.0 and the client API and the server API of version 1.26.
If we dissect the internals of the docker version
subcommand, then it will first list the client-related information that is stored locally. Subsequently, it will make a REST API call to the server over HTTP to obtain server-related details.
Learn more about the Docker environment using the docker info
subcommand:

As you can see, in the output of a freshly installed Docker Engine, the number of Containers
and Images
is invariably nil. The Storage Driver
has been set up as aufs
, and the directory has been given the /var/lib/docker/aufs
location. The runtime has been set to runc
. This command also lists details, such as Logging Driver
, Cgroups Driver
, Kernel Version
, Operating System
, CPUs
, and Total Memory
.
Client-server communication
On Linux installations, Docker is usually programmed to carry out the server-client communication using the Unix socket (/var/run/docker.sock
). Docker also has an IANA-registered port, which is 2375
. However, for security reasons, this port is not enabled by default.