Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 111 ยท Getting Started

Podman, containerd, Wasm and the OCI Landscape

Understand the OCI image and runtime specs, how Docker Engine, containerd and runc fit together, and where Podman, CRI-O, gVisor, Kata and WebAssembly come in.

You have used the docker command since the first lesson, so it is easy to think that "container" means "Docker". It does not. Containers are a Linux feature, and the way images are described and containers are started is written down in open standards. Several tools implement those standards: Docker is the best known, but Kubernetes clusters usually run containerd or CRI-O, many Linux servers use Podman, and security-minded platforms swap in sandboxing runtimes. An image you build with Docker runs on all of them.

This lesson draws the map. You will learn what the Open Container Initiative (OCI) standardised, what runs underneath the docker command on your machine (we can inspect it), how Podman and the others differ, and what WebAssembly containers are. It is a "Getting Started" lesson because understanding the layers makes every later lesson, from How Docker Works to Docker in Docker, easier to place. Commands ran on Docker Engine 29.8 on Docker Desktop; Podman and the other tools are described without running them, because they are not installed here.

The Open Container Initiative

When Docker became popular, other companies feared that "container" would mean "whatever Docker does". In 2015 Docker, CoreOS, Google, Red Hat and others founded the Open Container Initiative under the Linux Foundation. It maintains three specifications:

Spec Defines Example consequence
Image spec The format of an image: manifest, config and layers, identified by digests An image built by Docker, Buildah or Kaniko can be pulled by anything
Runtime spec The on-disk "bundle" (a root file system plus config.json) and what a runtime does with it runc, crun or youki can start the same bundle
Distribution spec The HTTP API of a registry Hub, GHCR, ECR, Harbor and registry:2 speak the same protocol

You have already seen the image spec in action. Ask the registry for the raw index of Alpine and look at its first field:

CONSOLE
$ docker buildx imagetools inspect alpine:3.22 --raw | head -c 120
{"manifests":[{"annotations":{"com.docker.official-images.bashbrew.arch":"amd64","org.opencontainers.image.base.name":"scratch"...

The annotations use the org.opencontainers.image.* names that the spec defines. You can also see the standard layout on disk. docker save writes an OCI image layout:

CONSOLE
$ docker save alpine:3.22 -o alpine.tar
$ tar tf alpine.tar | head -4
blobs/
blobs/sha256/
blobs/sha256/19cb8e9506516110d7711504311fa893fe98adab3691e6caeeed3bb826c90b71
blobs/sha256/24ab38714e948bd49d24d566e97c1c104b63f85c2e642685e72393b37cfb9862
$ tar xf alpine.tar oci-layout index.json
$ cat oci-layout
{"imageLayoutVersion":"1.0.0"}
$ head -c 160 index.json
{"schemaVersion":2,"mediaType":"application/vnd.oci.image.index.v1+json","manifests":[{"mediaType":"application/vnd.oci.image.index.v1+json","digest":"sha256:2e0b81d6...

The archive has an oci-layout marker file, an index.json and a blobs/sha256/ folder where every blob is named after its digest. Any OCI-aware tool can read this folder, with or without Docker (see Save, Load and Export for the commands).

What runs when you type docker run

The docker command is only a client. It talks to the Docker Engine (the dockerd daemon), and the engine hands the real work down a stack of components, each with a clear job:

flowchart TD
    CLI["docker CLI"] --> D["dockerd<br/>Docker Engine: API, builds, networks, volumes"]
    D --> C["containerd<br/>images, snapshots, container lifecycle"]
    C --> S["containerd-shim<br/>one per container"]
    S --> R["runc<br/>OCI runtime: creates namespaces and cgroups"]
    R --> P["Your process<br/>PID 1 in the container"]

The CLI calls the engine, the engine calls containerd, containerd starts a shim, the shim calls runc, and runc starts your process.

  • dockerd is the part users know: the REST API, docker build, networks, volumes, Compose integration.
  • containerd is a daemon that manages the container lifecycle, pulls and stores images and handles snapshots (the file system layers). Docker donated it to the CNCF, and Kubernetes uses it directly.
  • The shim is a tiny per-container process that keeps your container alive and its output flowing even if containerd restarts.
  • runc is the reference implementation of the OCI runtime spec. It sets up namespaces, cgroups and mounts, executes your process, and exits. It is the component that actually "creates the container".

You can ask your own installation which versions it uses:

CONSOLE
$ docker version --format '{{range .Server.Components}}{{.Name}} {{.Version}}{{"\n"}}{{end}}'
Engine 29.8.1
containerd v2.3.5
runc 1.5.1
docker-init 0.19.0

docker-init is the tiny init process used by docker run --init (Signals and Init). To see which runtimes the engine knows, and which one is the default:

CONSOLE
$ docker info --format 'default={{.DefaultRuntime}}'
default=runc
$ docker info --format '{{range $k,$v := .Runtimes}}{{$k}} {{end}}'
io.containerd.runc.v2 nvidia runc

This machine has three entries: runc, the same via its containerd name, and nvidia, a runtime added by the NVIDIA toolkit for GPUs (GPUs and Devices). Every container has a runtime recorded in its host config, and you can choose one per container:

CONSOLE
$ docker run --rm --runtime=runc alpine:3.22 echo via runc
via runc
$ docker run --rm --runtime=nope alpine:3.22 true
docker: Error response from daemon: unknown or invalid runtime name: nope

Changing the default runtime is a daemon setting (default-runtime in daemon.json). The point: the runtime is a plug-in slot. Anything that implements the OCI runtime interface can fill it.

Alternative low-level runtimes

Because the runtime spec is open, several implementations exist, and each makes a different trade-off:

Runtime Idea
runc Reference runtime, written in Go; the default almost everywhere
crun Same spec written in C, lighter and faster to start; default in Podman on Fedora and RHEL
youki A runtime written in Rust
gVisor (runsc) A user-space kernel that intercepts system calls. The container talks to gVisor, not directly to the host kernel, which is a much smaller attack surface
Kata Containers Each container (or pod) runs inside a lightweight virtual machine with its own kernel
Firecracker-based runtimes MicroVMs, as used by serverless platforms

The last three are sandboxed runtimes. They trade a little speed and compatibility for a stronger boundary than a plain shared-kernel container, which is useful for running code you do not trust. They connect to the discussion of isolation in Container Security Basics and Seccomp and AppArmor. Using one with Docker typically means registering it in daemon.json and then adding --runtime=runsc to docker run; that is a read-only example here because it needs a Linux host with the runtime installed.

Higher-level engines

Above the OCI runtime sits the container engine: the program that pulls images, prepares file systems and calls a runtime.

  • Docker Engine (dockerd + containerd + runc) is the all-in-one choice with the best-known workflow and the largest ecosystem: Compose, BuildKit, Desktop, extensions.
  • containerd alone can run containers without dockerd. Its command line ctr is a debugging tool; the friendly CLI is nerdctl, which mimics docker commands (and nerdctl compose). Kubernetes nodes usually run containerd.
  • CRI-O is an engine written only for Kubernetes. It implements Kubernetes' Container Runtime Interface (CRI) and nothing else, and is the default of OpenShift.
  • Podman is a Docker-compatible CLI from Red Hat with a different architecture, described next.

Kubernetes removed its built-in Docker integration ("dockershim") in version 1.24. That did not make Docker images stop working: images follow the OCI spec, so a cluster running containerd or CRI-O pulls and runs them exactly as before.

Podman

Podman aims at being a drop-in replacement for the Docker CLI: podman run, podman ps, podman build and podman pull take the same arguments, and many people simply write alias docker=podman. The differences are in the design:

  • Daemonless. There is no always-running dockerd. Each podman command starts the container as a child process directly (through a small monitor called conmon), so there is no single privileged daemon that all clients talk to.
  • Rootless by default. Normal users can run containers without root privileges, using user namespaces. Docker supports rootless mode too, but it is an option rather than the default.
  • Pods. podman pod create groups containers that share a network namespace, like a Kubernetes pod. podman generate kube and podman kube play convert between running pods and Kubernetes YAML.
  • systemd integration. Instead of a restart policy handled by a daemon, Podman containers can be managed as systemd services using files called Quadlets, which makes them first-class services on a Linux server.
  • Tools around it. Buildah builds images (with or without a Dockerfile) and Skopeo copies and inspects images between registries without pulling them to local storage. Together with Podman they are the Red Hat family of container tools.

A session with Podman looks almost identical to Docker. This is a read-only example:

CONSOLE
$ podman run --rm -it alpine:3.22 echo hello
hello
$ podman ps -a
$ podman build -t myapp .
$ podman compose up      # runs docker-compose or podman-compose with Podman as the engine

For you as a learner, nearly everything in this course works with Podman too. The pieces that differ are Docker-specific features: Docker Desktop extensions, the Docker socket (/var/run/docker.sock) that many tools assume, BuildKit-only Dockerfile features (Podman uses Buildah, which supports most of them) and some networking details. Podman also offers a Docker-compatible API socket so tools that expect Docker can still talk to it.

Other helpers on desktops: Podman Desktop, Rancher Desktop, Colima and Lima (macOS and Linux VMs running containerd or Docker) and OrbStack (macOS). Because Windows and macOS cannot run Linux containers natively, every one of them starts a Linux virtual machine in the background, as Docker Desktop does; on this Windows machine uname -r inside a container ends with microsoft-standard-WSL2 for exactly that reason.

Choosing between them

If you... Then...
Are learning, building images, using Compose Docker. This course assumes it
Run a Linux server and want services managed by systemd Podman with Quadlets is a strong option
Run Kubernetes The cluster uses containerd or CRI-O; you still build images with Docker, Buildah or Kaniko
Run untrusted code Add a sandboxed runtime (gVisor, Kata) or microVMs
Need a free desktop alternative at work Podman Desktop, Rancher Desktop or Colima, depending on your licence and OS

The standards make this a low-risk choice: images and registries are interchangeable, so you can start with Docker and move later.

WebAssembly containers

WebAssembly (Wasm) is a compact binary instruction format that was invented for browsers and has spread to servers. A Wasm module runs in a sandbox with no direct access to the host unless it is granted capabilities through WASI, the WebAssembly System Interface. Compared with a Linux container, a Wasm "container" has:

  • Tiny images: often a few hundred kilobytes, since there is no operating system layer, only your compiled module.
  • Millisecond start-up and very low memory use, which suits functions that start on demand.
  • Portability across CPU architectures: the same .wasm file runs on amd64 and arm64, so no multi-platform builds are needed.
  • A different capability model: no namespaces and cgroups; the sandbox is the Wasm runtime itself.

The cost is maturity: not every language and library compiles to Wasm, networking and threading support is still evolving, and the tooling changes quickly. Containerd supports Wasm through runwasi shims that wrap runtimes such as Wasmtime and WasmEdge. Docker Desktop and Engine can use them with the containerd image store. The workflow looks like this (read-only example; it needs a Wasm shim installed):

CONSOLE
$ docker buildx build --platform wasi/wasm -t example/hello-wasm .
$ docker run --rm --runtime=io.containerd.wasmtime.v1 --platform=wasi/wasm example/hello-wasm

The image platform is wasi/wasm instead of linux/amd64, and the runtime option picks a shim instead of runc. The Dockerfile typically starts FROM scratch, copies the .wasm file in and sets it as the entrypoint. Wasm containers are a good fit for small stateless services at the edge or plugins; Linux containers remain the right tool for databases and the vast majority of existing software.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which OCI specification makes it possible for Docker, Buildah and Kaniko to produce images that every registry and runtime understands?

    The image spec defines manifests, configs, layers and digests. The runtime spec is about starting a container from a bundle, and the distribution spec is the registry API.
  2. 2. In the stack dockerd, containerd, shim, runc, which component actually sets up namespaces and cgroups and starts your process?

    runc is the OCI runtime. The engine and containerd manage images and lifecycle, but runc creates the isolated environment and executes the process.
  3. 3. What is a key architectural difference of Podman compared with Docker Engine?

    Podman starts containers directly as child processes without a long-running daemon, and rootless operation is its default. It runs the same OCI images.
  4. 4. Why are gVisor and Kata Containers described as sandboxed runtimes?

    Both reduce the exposure of the host kernel. gVisor intercepts system calls in user space, and Kata runs each workload in a micro virtual machine.
  5. 5. Kubernetes removed dockershim in version 1.24. What does that mean for your Docker-built images?

    Images follow the OCI spec, so any compliant engine can run them. Only the Docker-specific integration layer in Kubernetes went away.

Summary

  • The OCI defines three standards: image, runtime and distribution. That is why images are portable between tools.
  • Docker Engine is a stack: dockerd (API and builds), containerd (lifecycle, images), a shim per container and runc (creates the container). Check yours with docker version and docker info.
  • The runtime is replaceable: --runtime= selects another one, such as crun, gVisor (runsc), Kata or an NVIDIA wrapper.
  • Podman is a daemonless, rootless-first, Docker-compatible CLI with pods and systemd/Quadlet support, supported by Buildah and Skopeo. CRI-O and plain containerd are the typical Kubernetes engines.
  • Wasm containers are tiny, fast and architecture-independent but less mature; they run through containerd shims with --platform=wasi/wasm.
  • Because of the standards, learning Docker first is no lock-in.

Next: What Is an Image?