Docker Tutorial — Architecture Exercises

1 minute read

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
  1. Docker CLI — sends REST API request to daemon
  2. Docker Daemon (dockerd) — receives request, checks for image locally, pulls from Docker Hub if needed
  3. containerd — prepares the container bundle and filesystem
  4. runc — creates namespaces and cgroups, starts the nginx process
  5. Container — nginx is now running as an isolated process

Exercise 2 — Images vs Containers

Question: True or False:

  1. An image changes when you create a container from it.
  2. You can create multiple containers from the same image.
  3. Data written inside a container is lost when the container is removed.
  4. Image layers are shared between containers.
Show Answer
  1. False — Images are immutable (read-only)
  2. True — One image, many containers
  3. True — Unless you use volumes for persistent storage
  4. 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
  1. bridge — default network for containers
  2. host — container shares host network stack
  3. 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 registry
  • library — official images namespace
  • nginx — image name
  • latest — 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

← Docker Hub Overview Images →

Updated: