$linuxjunkies
>

image layer

also: layer, OverlayFS layer, container layer

A read-only snapshot of filesystem changes in a container or virtual machine, stacked to form a complete filesystem. Layers are combined using a union filesystem to create the final runtime environment.

An image layer is an immutable, incremental snapshot of filesystem modifications created during the build process of a container image. Each layer represents the state of the filesystem after executing a single instruction (like RUN, COPY, or ADD) in a Dockerfile.

Layers are stacked on top of each other in order, with a union filesystem (typically OverlayFS) combining them into a single view. When a container starts, a thin read-write layer is placed on top of all the read-only image layers, allowing the container to modify files without changing the underlying image.

For example, a Dockerfile with three RUN commands creates three layers: the base OS layer, a layer with installed packages, and a layer with application code. Docker reuses unchanged layers across images, saving storage space and accelerating builds.

Related terms