# Image Layer

> One saved set of file changes. Layers stack up to make a container image.

**Field:** Infrastructure  
**Category:** Containers  
**Also known as:** Docker Layer, Container Image Layer, Layer Cache

## Think of it like

Think of it like a stack of see-through sheets. Each sheet adds a little to the picture.

## Definition

An image layer is one saved set of file changes inside a container image. Build steps that change files each add a layer, such as installing a package or copying in code. The layers stack up to make the whole image. Once made, they never change. Images that start the same way share those layers, so they are stored and downloaded once. A running container adds one thin layer on top where it can write.

## Example

Jack's build installs packages, then copies in his code. He changes one file. The rebuild reuses the package layer and only redoes the last one.

## Why it matters

Layers make builds and downloads fast, because only changed layers are redone. The order of steps decides how much is reused.

## Common mistake

Copying all the code before installing packages. Then any code change redoes the slow install step too.

## Three principles

- **Stacked changes.** Each layer adds or changes files.
- **Never changed.** A finished layer stays as it is.
- **Shared and cached.** The same layer is reused, not redone.

## Related terms

- [Container Image](https://learn.benibix.com/term/infrastructure/container-image)
- [Dockerfile](https://learn.benibix.com/term/infrastructure/dockerfile)
- [Base Image](https://learn.benibix.com/term/infrastructure/base-image)
- [Multi-Stage Build](https://learn.benibix.com/term/infrastructure/multi-stage-build)
- [Container](https://learn.benibix.com/term/infrastructure/container)

![A stack of four layers. At the bottom the base image from the FROM line, then a layer of installed packages, then a layer of app code. A thin dashed writable layer sits on top for a running container. A label reading myapp:1.2 points at the stack.](https://learn.benibix.com/diagrams/inf4-image-layers.svg)

---

Source: https://learn.benibix.com/term/infrastructure/image-layer
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
