fivenines
1/40
Lesson 1 · Foundations

What Problem Does Docker Solve?

In one sentence: Docker packages an application together with everything it needs into a portable, isolated unit, and gives you one toolchain to build, ship, and run those units anywhere.

You already know

  • The pain of "works on my machine": an app runs in dev, then breaks in production because a library, config file, or OS version differs.
  • Shipping physical goods was revolutionized by the standardized shipping container — one box shape, any cargo, any ship.

The matrix of hell

Before containers, every app × every environment was a unique deployment problem. Three apps on four environments (laptop, CI, staging, prod) means twelve fragile combinations, each hand-tuned. Docker collapses the matrix with one abstraction: if your app runs in a container, and the environment runs containers, then your app runs in that environment. The container is the contract.

Three nouns, one daemon

Everything in Docker reduces to three nouns. An image is a frozen, immutable snapshot of an app and its dependencies — the recipe and the pantry, sealed together. A container is a running (or runnable) instance of an image — the dish, cooking. A registry is a shared shelf where images are published and fetched. One long-running program, the daemon, manages all three; a thin CLI just sends it requests over an HTTP API.

Architecture — the four boxes every later lesson refines
flowchart LR
  subgraph Client["Your terminal"]
    CLI["docker CLI
(thin client)"] end subgraph Host["Docker host"] D["Docker daemon
(the brain)"] IMG[("Image store
frozen snapshots")] CT["Containers
running instances"] end REG[("Registry
shared image shelf")] CLI -- "REST API
(run, build, pull …)" --> D D -- manages --> IMG D -- "creates + supervises" --> CT D -- "pull / push" --> REG IMG -. "instantiate" .-> CT

One command, end to end

Watch the nouns cooperate. When you type docker run nginx, the CLI does almost nothing — the daemon does almost everything:

Sequence — docker run at 10,000 feet
sequenceDiagram
  actor U as You
  participant CLI as docker CLI
  participant D as Daemon
  participant R as Registry
  U->>CLI: docker run nginx
  CLI->>D: POST /containers/create (image nginx)
  D->>D: image in local store?
  alt not local
    D->>R: pull nginx
    R-->>D: image data
  end
  D->>D: create container from image
  D->>D: start container
  D-->>CLI: container id + output stream
  CLI-->>U: nginx is running
    

Anchor these

  • Image = frozen snapshot, container = running instance, registry = shared shelf.
  • The CLI is thin; the daemon owns all real work behind a REST API.
  • The container is a contract that collapses the app × environment matrix.
Next step

See what actually stuck.

Take the practice scenarios now.