KCNA ยท Containers and images
Images, layers and registries
Image layers, tags vs digests, registries, pulling and pushing, image immutability.
Key points
- A container image is a packaged, read-only filesystem plus metadata, built from stacked layers that can be shared and cached between images.
- Images live in a registry and are referenced as registry/name:tag or registry/name@sha256:digest.
- A tag is a movable human-friendly label; a digest is a content hash that always points to exactly one image.
- Running a container never changes its image.
Source: https://kubernetes.io/docs/concepts/containers/images/
Practice questions
Which part of an image reference identifies one exact, immutable image?
- The digest (sha256:...)
- The tag (for example 1.4)
- The registry hostname
- The repository name
Show answer
Answer: A. The digest (sha256:...)
A digest is a hash of the content, so it cannot point to anything else. Tags can be moved to a different image at any time.
Which statements about image layers are true?
- Layers can be shared between different images
- Image layers are read-only
- Writing a file in a running container edits the image layers
- A tag is a hash of the layer contents
- A pull can skip layers already present on the node
Show answer
Answer: A. Layers can be shared between different images, B. Image layers are read-only, E. A pull can skip layers already present on the node
Layers are read-only and reused across images, so a pull skips layers the node already has. Writes in a running container do not alter the image layers, and a tag is a label, not a content hash.
True or false: an image tag such as 1.0 always refers to the same image content.
Show answer
Answer: False
False. Tags are mutable labels the registry owner can repoint; only a digest is fixed to the content.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
