rust_musl_wasm image is used mainly a builder image for rust projects that need to build for wasm and musl targets.
Git Repo
It's built on top of rust:1 so, it's a debian based image with rust and the following targets installed:
- wasm32-unknown-unknown
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- wasm32-wasi
The image has tools to build musl and wasm targets:
- wasm-bindgen
- wasm-pack
- wasm-opt
- wasmtime
- trunk
- mdbook (documenting tool)
docker pull ahmedthabet/rust_musl_wasm
FROM ahmedthabet/rust_musl_wasm:latest as builder
WORKDIR /app
RUN cargo build --release --target wasm32-unknown-unknown
# or
RUN cargo build --release --target x86_64-unknown-linux-musl
# Then build a minimal image for your executable if needed
FROM --platform=x86_64 scratch
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/myapp /app
CMD ["/app"]