Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 609 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 609 Bytes

Compile a C file and run in Docker/WASM container

  1. Compile your WASM binary
  2. Build the image
  3. Run the WASM container

Compile your WASM binary

 docker run --rm -itd -v ${pwd}:/src emscripten/emsdk emcc helloworld.c -o helloworld.wasm

Build the image

docker buildx build --platform wasi/wasm -t docker-wasm:0.1 .

Run the WASM container

docker container run --rm --name=dockerwasm --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm docker-wasm:0.1