Skip to content
BIASED

Container images

Block 1 of 5~3 min

What an image is

A built program still needs an interpreter or libc, locked packages, OpenSSL, CA certificates and a timezone database. Copying only the binary to a server recreates "works on my laptop" failures. A container image ships the program with the user-space file tree it expects. The OS course covered how a container runs (namespaces, cgroups, OverlayFS). This topic is the image — the artifact CI builds and CD promotes.

By the OCI image specification an image is a small graph of blobs named by SHA-256 digests:

  • Layers — compressed tar archives of files one build step added, changed or deleted. A typical node:20-slim base may be ~200 MB compressed; your npm ci layer another 150 MB; the application copy 5 MB.
  • Config — JSON: architecture, Cmd/Entrypoint, env, working directory, user, rootfs.diff_ids.
  • Manifest — JSON naming config and layers by digest; the manifest digest is the image identity.
  • Index — for multi-arch, a list of manifests (a tag like alpine:3.22 often points here so linux/amd64 and linux/arm64 resolve correctly).

Nothing here requires Docker: you can write an OCI layout by hand or build with BuildKit, Podman or Kaniko. Changing one byte in a file changes that layer's digest and therefore the manifest — a Merkle tree, like Git. Two tags can point at the same digest; one tag can move to a new digest tomorrow. Deploy digests, not floating tags.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • Image layers and cache hashoptional

    For a 5-step Dockerfile mark which layer a COPY vs RUN apt edit invalidates.

    ~20 min · easier on a computer · The matching course topic has been read.

    Self-check in the notebook — not part of mastery or the certificate.