liveBook · Manning

Containerd-shim

As explained in Server-Side WebAssembly

containerd-shim is a helper process that connects containerd to a running container and manages container lifecycle and I/O after the parent runtime exits.

A containerd-shim is a helper process between containerd’s runtime and a running container. It keeps the container alive after the parent runtime exits, redirects logs, and manages lifecycle events such as pausing and restarting. section 7.2

The container execution path separates orchestration, runtime startup, and ongoing container management:

  • Docker Engine uses runC to spawn the container process. section 7.2
  • runC hands control to containerd-shim once the container is running. section 7.2
  • containerd coordinates shims, the host system, and external resources. section 7.2
  • For Wasm, a specialized shim such as containerd-shim-wasm connects containerd to a Wasm runtime such as Wasmtime; io.containerd.spin.v2 supports Spin applications. section 7.2 section 7.5

Run a Wasm container through a shim

sudo ctr run --rm --runtime io.containerd.wasmtime.v1 --platform wasi/wasm32 docker.io/library/hello-wasm-container:latest hello-wasm-instance section 7.5

Figure 7.4 A closer look inside the Docker engine when executing a Wasm module, showing the key components, including containerd-shim-wasm and the Wasm runtime

Use the architecture diagram to compare ordinary container execution with the Wasm path, where containerd-shim-wasm connects containerd to a Wasm runtime. section 7.2

How Server-Side WebAssembly covers it

How deep it goes
Explains the runtime handoff, helper responsibilities, and Wasm variants, but does not descend into shim implementation internals.
Examples
Uses Docker Engine architecture diagrams, a ctr Wasmtime command, and comparisons with Spin and wasmCloud packaging.
What it assumes
Introduces the traditional Docker, runC, and containerd execution layers before applying the same architecture to Wasm.
What you can do after
Operate/configure Wasm containers through containerd using the io.containerd.wasmtime.v1 runtime option.
How it connects
Ties containerd-shim to Docker Engine, runC, containerd, Wasmtime, Spin, Wasm runtimes, and wasmCloud.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.