HomeWorkArchiveDocker Multi-Stage

A thousand megabytes. Four lines.

A single-stage Go image ships the SDK, the build cache and the OS to production. A teardown of the Docker Multi-Stage reel that shears all three away and leaves a 12 MB binary.

Storyboard

  1. 00:00

    Hook: the image is a monolith

    Your Go Docker image reads 1,000 MB. Layer labels enter biggest first: OS 420 MB, Go SDK 380 MB, Build Cache 188 MB, Binary 12 MB. A hard swap replaces the stack with a 4-line multi-stage build and 12 MB.

  2. 00:03

    Tension: every layer has a weight

    The proof scene rebuilds the stack at true proportion. The OS is 420 MB, the Go SDK 380 MB, the build cache 188 MB, and the binary only 12 MB. Four landing beats mark each part of the build.

  3. 00:08

    Visual proof: the layers shear away

    Each unnecessary layer is cut and falls out of frame, then the camera recedes. The distroless result locks dead center, the 12 MB figure settles, and a recap names the four Dockerfile lines that did it.

  4. 00:12

    Resolution: four lines, one result

    The closing card reads 4 lines. Then 98.8% smaller. The handle lands and the frame holds static for the final second, so the Dockerfile idea and the number are both readable at a glance.

See where your queue breaks.

A free 20-minute teardown. No prep, no pitch.

Book a teardown