IT lexicon › Infra & Ops › overlayfs

overlayfs

Infra & Ops På svenska → Updated: 2026-05-29

The union filesystem in the Linux kernel that stacks a container image's layers into a single coherent filesystem, with a thin writable layer on top. It's what lets many containers share the same immutable image layers without copying them.

Mechanic: overlayfs merges a "lower" (the immutable, shared image layers, read-only) with an "upper" (the container's own writable layer) into a "merged" view. When the container reads a file it comes from the layers; when it WRITES to a file, a copy-on-write happens — the file is copied up to the writable layer and changed there, the original layer is never touched. Win: ten containers from the same image share the layers on disk (one copy) and only have their own diffs; startup is fast (nothing is copied until it's written). It explains why containers are so space- and startup-efficient compared with full VM images. When the container dies the writable layer is discarded (which is why container filesystems are ephemeral). The basis for how container images materialize at runtime. Related to image layer and container runtime interface.

← Back to the lexicon