Docker from the kernel up · check

Know Images already?

One question for each of the 8 puzzles in this module. A right answer marks that puzzle as passed, so you can jump ahead. A wrong one tells you which puzzle to start with. Nothing is sent anywhere: it's saved in this browser.

Puzzle 9: What is inside an image?

A container from notes:v1 deletes /notes.txt, and you commit it as notes:v3. How many layers does notes:v3 have, and how big is the new one?

Right. Each commit adds a layer of changes; deleting hides, never removes.

Not quite. The bytes stay in layer 2; the whiteout only hides them. Learn it in puzzle 9 →

Not quite. Layers only add on top; a deletion is a new layer with a whiteout. Learn it in puzzle 9 →

Puzzle 10: Stacking layers into one tree

A container from an image with a 1 GB database file in a lower layer appends one line to that file. What happens on disk?

Not quite. The overlay filesystem copies whole files, not changed parts. Learn it in puzzle 10 →

Right. Copy-up copies the whole file before the first write.

Not quite. Lower directories are read-only; every change lands in upper. Learn it in puzzle 10 →

Puzzle 11: The container's own layer

A service writes its SQLite database inside its container's tree. You deploy a new version by removing the old container and starting a new one from the new image. What happens to the data?

Not quite. Each container gets a new, empty writable layer; nothing is carried over. Learn it in puzzle 11 →

Right. A container's writes die with docker rm.

Not quite. Writes never go into image layers; they stay in the container's own layer. Learn it in puzzle 11 →

Puzzle 12: Where images live on disk

A machine with the containerd image store pulls an image whose layers are 200 MB compressed and 600 MB unpacked. Roughly how much disk does it take?

Right. Both copies stay.

Not quite. The snapshotter unpacks them when the image is pulled. Learn it in puzzle 12 →

Not quite. That's the older storage driver; the containerd store keeps both. Learn it in puzzle 12 →

Puzzle 13: Named by its content

You rebuild an image and only one file in its top layer changes, by one byte. Which digests change?

Not quite. The config lists the layer's DiffID, and the manifest lists the config's digest, so both change too. Learn it in puzzle 13 →

Right. A change ripples up through every name that lists it.

Not quite. Any change gives a completely different digest. Learn it in puzzle 13 →

Puzzle 14: Tags move, digests don't

A build script on your build server runs docker pull alpine:3.20 and builds on top of it. It ran last month; today it runs again with no change. Can it start from a different image?

Not quite. Tags are pointers that pushers can move; only a digest is fixed. Learn it in puzzle 14 →

Right. A tag can move between builds.

Not quite. The digest is made from the content; a tag is a separate, movable name. Learn it in puzzle 14 →

Puzzle 15: Pulling from a registry

You pull an image built on alpine:3.20 that adds two layers; alpine:3.20 is already on your machine. Which blobs are downloaded?

Not quite. Layers are fetched by digest, and Alpine's layer digest is already on disk. Learn it in puzzle 15 →

Right. Only what's missing, found through the manifest.

Not quite. The engine needs the manifest first: it is how it learns which digests to fetch. Learn it in puzzle 15 →

Puzzle 16: One name, many machines

A teammate on an Apple-silicon Mac and a build server on Intel both pull alpine:3.20 by the same index digest. Do they run the same layer bytes?

Right. One index, different manifests per platform.

Not quite. Unpacking changes nothing; each machine pulls different layers. Learn it in puzzle 16 →

Not quite. The digest names the index; the index points at a different manifest per platform. Learn it in puzzle 16 →

Back to the overview →