Chapter 2. Understanding Docker—inside the engine room

 

This chapter covers

  • Docker’s architecture
  • Tracing the internals of Docker on your host
  • Using the Docker Hub to find and download images
  • Setting up your own Docker registry
  • Getting containers to communicate with each other

Grasping Docker’s architecture is key to understanding Docker more fully. In this chapter you’ll get an overview of Docker’s major components on your machine and on the network, and you’ll learn some techniques that will develop this understanding.

In the process, you’ll learn some nifty tricks that will help you use Docker (and Linux) more effectively. Many of the later and more advanced techniques will be based on what you see here, so pay special attention to what follows.

2.1. Docker’s architecture

Figure 2.1 lays out Docker’s architecture, and that will be the centrepiece of this chapter. We’re going to start with a high-level look and then focus on each part with techniques designed to cement your understanding.

Figure 2.1. Overview of Docker architecture

Docker on your host machine is (at the time of writing) split into two parts—a daemon with a RESTful API and a client that talks to the daemon. Figure 2.1 shows your host machine running the Docker client and daemon.

RESTful

A RESTful API is one that uses standard HTTP request types such as GET, POST, DELETE, and others to perform functions that usually correspond to those intended by HTTP’s designers.

2.2. The Docker daemon

Technique 1 Open your Docker daemon to the world

Technique 2 Running containers as daemons

Technique 3 Moving Docker to a different partition

2.3. The Docker client

Technique 4 Use socat to monitor Docker API traffic

Technique 5 Using ports to connect to containers

Technique 6 Linking containers for port isolation

Technique 7 Using Docker in your browser

2.4. Docker registries

Technique 8 Setting up a local Docker registry

2.5. The Docker Hub

Technique 9 Finding and running a Docker image

2.6. Summary

sitemap