7 Introduction to Wasm containers with Docker
This chapter covers
- The differences between containers and Wasm
- Wasm containers
- Distributing Wasm as OCI images
- Containerizing wasmCloud applications
- Converting containers to Wasm
We’ve come a long way from manually handling String objects by storing their UTF-8 encoded characters in a Wasm module’s linear memory and passing them across the host-to-module boundary using integer parameters for the String's length and memory location. In the previous chapter, we explored wasmCloud—a high-level Wasm runtime—and saw how it enables the use of standard and non-standard WIT interfaces to bring higher-level capabilities such as key-value stores and machine learning models to our Wasm applications.
However, one important aspect we’ve yet to explore—aside from briefly mentioning it in chapter 1—is Wasm’s distribution story. Traditionally, developers distribute and deploy their applications using containers, which package code and its dependencies into a single unit, allowing applications to run consistently across environments, from local machines to cloud platforms. At first glance, Wasm, as a hardware abstraction layer, may sound similar to containers—and if you think so, you’re not wrong!