WebAssembly Docker Container

Marco Kuoni
WebAssembly
Published in
12 min readOct 4, 2023

--

Content: Theory: Why? | Theory: How? | Docker Desktop Setup | Docker Build | Docker Run | Docker Compose | Performance | Further Resources

Why?

The famous quote from one of the inventors of Docker, Solomon Hykes: “If WASM+WASI existed in 2008, we wouldn’t have needed to created Docker.”

Solomon Hykes Twitter Post about WASM
Solomon Hykes Twitter Post about WASM

There is a follow-up tweet in which Solomon talks about Docker not disappearing as a result. Instead, Windows, Linux, and WebAssembly containers will be used together and side by side with Docker.

Containers Compared
Containers Compared, Image by Kode Kloud

Classic Docker containers or their contents are compiled for a specific target architecture (arm, x86, etc.) and include various operating system components.

Now, when a WebAssembly runtime is available, these points can be handed over to the runtime. As a result, you get a container with the following additional advantages:

  • Includes only application code, leading to smaller (memory) and more secure (attack surface) containers with faster startup times.
  • Compatibility across different architectures and operating systems.

--

--

Marco Kuoni
WebAssembly

CTO lemonbrain, BSc electrical engineering, cand. BSc computer science