Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Docker

You're reading from   Learning Docker Build, ship, and scale faster

Arrow left icon
Product type Paperback
Published in May 2017
Publisher
ISBN-13 9781786462923
Length 300 pages
Edition 2nd Edition
Tools
Arrow right icon
Authors (3):
Arrow left icon
Jeeva S. Chelladhurai Jeeva S. Chelladhurai
Author Profile Icon Jeeva S. Chelladhurai
Jeeva S. Chelladhurai
Pethuru Raj Pethuru Raj
Author Profile Icon Pethuru Raj
Pethuru Raj
Vinod Singh Vinod Singh
Author Profile Icon Vinod Singh
Vinod Singh
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started with Docker FREE CHAPTER 2. Handling Docker Containers 3. Building Images 4. Publishing Images 5. Running Your Private Docker Infrastructure 6. Running Services in a Container 7. Sharing Data with Containers 8. Orchestrating Containers 9. Testing with Docker 10. Debugging Containers 11. Securing Docker Containers 12. The Docker Platform – Distinct Capabilities and Use Cases

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.

You have been reading a chapter from
Learning Docker - Second Edition
Published in: May 2017
Publisher:
ISBN-13: 9781786462923
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image