C.W.K.
Stream
Lesson 06 of 07 · published

OCI Standard — Why You Are Not Locked In

~12 min · foundations, standards

Level 0Container Curious
0 XP0/36 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Two specs, one industry

The Open Container Initiative (OCI) is a Linux Foundation project that standardizes:

  1. Image Specification — how container images are structured: manifest, config, layers, digests.
  2. Runtime Specification — how a runtime should create and run a container from a bundle.

Both Docker and Podman build images that satisfy the Image Spec. Both Docker (via runc) and Kubernetes (via containerd) use Runtime-Spec-compliant runtimes. An image built once runs anywhere OCI is honored.

Anatomy of an OCI image

  • Manifest — JSON document listing the config and the layers (each by digest).
  • Config — runtime defaults: CMD, ENV, exposed ports, working directory, user.
  • Layers — gzipped tarballs of filesystem diffs. Stack them with OverlayFS to get the running filesystem.
  • Digests — SHA-256 hashes. Two images with the same layer digests share the layer on disk. Reproducibility is built in.

Why this matters operationally

You build with Docker on your laptop, push to GitHub Container Registry, and pull-and-run in Kubernetes (which uses containerd). Nothing in this chain requires Docker the company. The artifacts are portable because the spec is what everyone agreed on.

Code

Inspect an image's manifest·bash
# Pull and inspect the manifest of a public image
docker buildx imagetools inspect --raw nginx:1.27-alpine | head -30

# Returns a JSON manifest with mediaType, config (digest, size),
# and layers (each with digest + size).

# Layer digests are the deduplication key —
# any two images sharing a layer share one copy on disk.

External links

Exercise

Pull the same image with two different tools (e.g., docker pull and nerdctl pull, or docker pull and podman pull). Compare the digest each prints. They should match. In one sentence, explain why that match is the OCI spec doing its job.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.