HUB
Sign inSign up

number9/wasi-build

By number9

•Updated over 6 years ago

A build environment for WASI - See https://gitlab.com/no9/wasi-build

Image
0

328

number9/wasi-build repository overview

⁠wasi-build

The Web Assembly System Interface (WASI)⁠ is designed to allow the execution of Web Assembly outside of the browser.

This technology currently requires some specific environment configuration that can clash with some setups. This project aims to enable people to build and run WASI projects as friction free as possible.

⁠usage

Based on the WASI Tutorial⁠

First create a Rust Project

$ cargo init hello --bin

Then create a docker file next to hello project directory:

FROM wasi-build:latest

WORKDIR /usr/src/

COPY hello hello
WORKDIR /usr/src/hello

RUN cargo +nightly build --target wasm32-unknown-wasi

CMD [ "wasmtime", "target/wasm32-unknown-wasi/debug/hello.wasm"]  

Then build and run the project

$ docker build -t wasi-rust-example .
$ docker run wasi-rust-example:latest

See https://gitlab.com/no9/wasi-build/tree/master/examples/rust⁠ for a working example

Tag summary
Recent tags
Content type
Image
Digest
Size
958.3 MB
Last updated
over 6 years ago
docker pull number9/wasi-build:latest