...

/

Containerize a Wasm App

Containerize a Wasm App

Learn how to containerize a Wasm app using Docker.

Docker Desktop lets you containerize Wasm apps so you can use familiar Docker tools to push and pull them to OCI registries and run them inside containers.

Creating a Dockerfile

As always, we need a Dockerfile that tells Docker how to package the app as an image. Create a new file called Dockerfile in your hello-world directory and populate it with the following three lines.

FROM scratch
COPY /target/wasm32-wasi/release/hello_world.wasm .
COPY spin.toml .
Creating a Docker image with the WASM application

The file references a special empty base image called scratch because Wasm containers don’t need a Linux OS.

The two ...