Docker Tutorial — Architecture Exercises
Practice what you’ve learned about Docker’s architecture, the daemon stack, images vs containers, and Docker Hub.
Exercise 1 — Trace the Flow
Question: When you type docker run nginx, list the components involved in order.
Show Answer
- Docker CLI — sends REST API request to daemon
- Docker Daemon (dockerd) — receives request, checks for image locally, pulls from Docker Hub if needed
- containerd — prepares the container bundle and filesystem
- runc — creates namespaces and cgroups, starts the nginx process
- Container — nginx is now running as an isolated process
Exercise 2 — Images vs Containers
Question: True or False:
- An image changes when you create a container from it.
- You can create multiple containers from the same image.
- Data written inside a container is lost when the container is removed.
- Image layers are shared between containers.
Show Answer
- False — Images are immutable (read-only)
- True — One image, many containers
- True — Unless you use volumes for persistent storage
- True — All containers from the same image share the same layers
Exercise 3 — Explore Docker Objects
Goal: List all four types of Docker objects on your system.
$ docker image ls
$ docker container ls -a
$ docker volume ls
$ docker network ls
Question: What are the three default networks Docker creates?
Show Answer
- bridge — default network for containers
- host — container shares host network stack
- none — no networking
Exercise 4 — Docker Hub
Question: What is the full image name when you run docker pull nginx?
Show Answer
docker.io/library/nginx:latest
docker.io— Docker Hub registrylibrary— official images namespacenginx— image namelatest— default tag
Exercise 5 — Component Roles
Question: Match each component to its role.
| Component | Role |
|---|---|
| dockerd | ? |
| containerd | ? |
| runc | ? |
Show Answer
| Component | Role |
|---|---|
| dockerd | API server — receives CLI commands, manages images/volumes/networks |
| containerd | Container lifecycle manager — start, stop, pause, delete containers |
| runc | Low-level runtime — creates containers using Linux namespaces and cgroups |