◂ Docker foundations TRK-01 reading

Docker foundations

Images, layers, and registries

Learn how Docker images are assembled, cached, tagged, pulled, and reused.

15 min docs

An image is a read-only stack of filesystem layers plus metadata for how to start a container. Each Dockerfile instruction usually creates a new layer, and Docker reuses unchanged layers to avoid rebuilding everything.

Registries store and distribute images. Tags are convenient names like latest or 1.2.0, but they can be moved; digests identify exact image content and are safer when repeatability matters.

01

Image layers

A Docker image is built as a sequence of filesystem changes. Installing packages, copying files, and setting permissions become part of the image history.

When a layer has not changed, Docker can reuse it. This is the reason Dockerfile order directly affects build speed.

02

Tags and digests

A tag is a human-friendly pointer. A digest is a content address. Use tags while learning and use pinned versions or digests when reproducibility matters.

docker pull ubuntu:24.04
docker image ls ubuntu
docker image inspect ubuntu:24.04
docker history ubuntu:24.04
03

Registry workflow

A registry is where images are stored. Pulling downloads missing layers; pushing uploads layers the registry does not already have.

In teams, the registry becomes the handoff point between build, CI, deployment, and rollback.

what to remember

  • Pin base images deliberately when the same build must behave the same way later.
  • Small layers are useful, but predictable dependency order matters more than clever one-liners.
  • When a pull is slow, Docker is usually downloading only the layers it does not already have.
KLOUD
guest @ /tracks/docker-foundations/images-layers-and-registries