跳至主要内容

Podman

Podman can launch a Wasm image through a crun binary built with WasmEdge support. If your host is already configured, go straight to run a WASI app.

Fedora Platform​

Install podman and WasmEdge​

Install the Fedora packages for Podman, WasmEdge, and crun. Check the runtime binary you will pass to Podman. For example, if your distribution installs it as /usr/bin/crun-wasm, run /usr/bin/crun-wasm --version and look for +WASM:wasmedge in the output.

Run A simple WASI app on Fedora​

For the packaged crun-wasm binary, run the Fedora hello-world image. The application prints Hello WasmEdge!.

Other Linux distributions​

Prerequisites​

Install Podman, WasmEdge, and a crun build with WasmEdge enabled. Run that binary with --version and check for +WASM:wasmedge.

Run A simple WASI app​

Set CRUN_PATH to the executable you checked. This example uses the crun on your shell's PATH.

CRUN_PATH="$(command -v crun)"
podman --runtime "$CRUN_PATH" run --rm \
--annotation module.wasm.image/variant=compat-smart \
docker.io/wasmedge/example-wasi:latest /wasi_example_main.wasm 50000000

The sample prints a random number and its command-line arguments, including 50000000. For a long-running workload, run an HTTP server and send a test request.