liveBook · Manning

Event history

As explained in Learn Docker in a Month of Lunches, Second Edition

Image history is the ordered metadata describing the filesystem layers and build steps that comprise a Docker image.

Event history is the ordered record of an image’s filesystem layers and build steps. Each Dockerfile instruction can add a layer, and later deletions hide files without removing their earlier layer. section 17.1

Use image history to inspect image structure and find avoidable size:

  • Run docker history on the image to expose layer sizes and the COPY step that added unnecessary files. section 17.1

A deletion does not erase a layer

COPY . . followed by RUN rm -rf docs hides docs in the merged filesystem, but the copied files remain in the image stack. Prefer COPY ./app ./app so unwanted files never enter a layer.

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains layer persistence and merged-filesystem masking, then stops short of lower-level storage internals.
Examples
Uses v1 and v2 Dockerfiles, docker history output, container runs, and a precise COPY optimization.
What it assumes
Assumes basic Docker image-building and Dockerfile knowledge while clarifying how layers preserve deleted data.
What you can do after
Diagnose image bloat with docker history and prevent unnecessary files from entering later image layers.
How it connects
Connects Dockerfile instructions, image layers, merged filesystems, build context, and image optimization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.