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.
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.
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.