Docker architecture
- Docker & Kubernetes course
- Beginner
- Lesson 4/82
- 4 min
Learn the architecture of daemon, CLI and registry.
Docker architecture
Docker has a client-server structure:
- Docker CLI (the
dockercommand): takes the commands you type. - Docker daemon (
dockerd): runs in the background; manages images, containers, networks and volumes. - Registry: the store where images are kept (Docker Hub, GitHub Container Registry...).
docker pull redis # CLI -> daemon -> download from the registry
docker run redis # CLI -> daemon -> create a containerA remote daemon
The CLI and the daemon don't have to be on the same machine. The CLI talks to a REST API over a socket or the network; with the DOCKER_HOST variable or docker context you can manage a daemon on another machine:
docker context create sunucu --docker host=ssh://ali@10.0.0.5
docker context use sunucu
docker ps # now lists the containers on the remote serverPractice Pull and run
Write two commands that first pull the redis image, then start a container named cache from it in the background.
Starter code
# buraya yazSample solution
docker pull redis
docker run -d --name cache redisExpected output
Using default tag: latest Status: Downloaded newer image for redis:latest 9b1c2d3e4f50
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which component actually creates and manages containers?
- Docker Hub
- The Dockerfile
- The Docker daemon (dockerd) Correct answer
- The Docker CLI
Explanation: The CLI only sends requests to the daemon over a REST API.
2 Download an image from the registry.
docker ____ redis
docker pull redis
Explanation: docker pull downloads the image from the registry into the local store.
3 Match the components with their jobs.
| Term | Meaning |
|---|---|
Docker CLI |
Sends commands |
dockerd |
Manages containers |
registry |
Stores images |
docker context |
Which daemon to connect to |