View on GitHub

Docker images, layer by layer

Cloud planned

Why your Docker image is 2 GB.

The idea

A Docker image is a stack of layers, one per build instruction. Layers are cached and shared, which makes builds fast, but a file added in one layer still takes up space even if a later layer deletes it.

Ordering instructions well and using multi-stage builds can cut an image from gigabytes to tens of megabytes.

What the lesson will build

Key ideas

The video

When it’s published, the code will live in cloud/ and this page will link to it.


All topics · Suggest a topic