Skip to content

What an image is

A layer is a diff, not a folder

What is actually inside an image: an ordered stack of filesystem diffs, each recording what changed rather than what exists.

The picture almost everyone starts with

Ask someone what a container image is and you will usually hear something like a zip file: a snapshot of a filesystem, packaged up, ready to unpack somewhere else. It is a reasonable guess and it explains nothing that actually happens.

An image is a stack of diffs. Each layer records what that step changed — files added, files replaced, files marked as deleted — and the filesystem a container sees is what you get by applying them in order. Nothing in an image describes the whole filesystem. Every layer describes a difference.

Almost every surprising thing about images falls out of that one sentence, and this track is mostly a series of consequences.

Dockerfile

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Layers

Nothing has been built yet. Press Build and the layers, the digest and the cache ledger appear — not before.

Everything you do here stays in this browser.Part of liter8.sh