Sign inSign up

opengg/rust-wasm

By opengg

•Updated almost 9 years ago

Minimal docker image for rust to wasm compilation. https://github.com/OpenGG/docker-rust-wasm/

Image
0

610

opengg/rust-wasm repository overview

⁠docker-rust-wasm⁠

Minimal docker image for rust to wasm compilation.

Based on Compiling Rust to Wasm manually with the LLVM wasm-backend (without Emscripten)⁠

⁠Usage

First, prepare your rust source file, e.g. add.rs.

#[no_mangle]
pub fn add_twenty_seven(n: i32) -> i32 {
  n + 27
}

Then run this docker image, compiling rust into wasm.

docker run -it --rm -v "$(pwd):/work" opengg/rust-wasm add.rs

⁠Run an interactive shell

Alternatively, you can run an interactive shell, exploring this docker image freely.

docker run -it --rm -v "$(pwd):/work" --entrypoint bash opengg/rust-wasm

Tag summary

Content type

Image

Digest

Size

509.5 MB

Last updated

almost 9 years ago

docker pull opengg/rust-wasm