container2wasm: Running Containers Anywhere Wasm Runs

Shriira Press

Preface

Take any container image and turn it into a WebAssembly module that runs on a Wasm runtime — or right inside a browser tab.

Welcome to container2wasm: Running Containers Anywhere Wasm Runs.

container2wasm, usually shortened to c2w, is a converter that takes an ordinary Linux container image and produces a WebAssembly module able to run on WASI runtimes such as wasmtime and wazero, and even inside a web browser with no server behind it. It solves a stubborn problem in the Wasm world: countless useful programs already exist as containers, but compiling each one to Wasm by hand is slow and often impossible. c2w sidesteps that entirely by bundling a small CPU emulator — Bochs for x86_64, TinyEMU for riscv64 — together with a Linux kernel and the container's own userspace, so the unmodified container simply runs on top of Wasm. This book walks through what c2w is and the problem it answers, how the emulation-based architecture is layered, the conversion pipeline that BuildKit and tools like wizer and wasi-vfs drive, the day-to-day command-line workflow with c2w and c2w-net, how networking and the browser story work, and finally where c2w fits among runwasi, Docker+Wasm, and the wider cloud-native ecosystem. By the end you will understand both how to use it and why it is built the way it is.

This title is part of the ShriIra library and is free to read in full, right here — our small contribution to making world-class knowledge easy to reach.

A note on reading it: open the Contents menu at the top of the reader to jump between chapters, use the Aa menu to set a comfortable text size, theme (light, sepia, or night), and single- or two-page layout. Your place is saved automatically, so you can always pick up where you left off.

We hope it serves you well.

— Shriira Press

Contents

  1. Chapter 1 — Containers, Meet WebAssembly
  2. Chapter 2 — The Emulation Architecture
  3. Chapter 3 — Inside the Conversion Pipeline
  4. Chapter 4 — Using c2w
  5. Chapter 5 — Networking and the Browser
  6. Chapter 6 — c2w in Practice
0%
1/1