dockerfiles/emscripten-rust

18 lines
582 B
Plaintext

FROM trzeci/emscripten:sdk-tag-1.38.41-64bit
# Install Rust
ENV RUST_VERSION=1.38.0
RUN curl -Lo rustup.sh https://sh.rustup.rs && \
sh rustup.sh --default-toolchain $RUST_VERSION --no-modify-path -y && \
rm rustup.sh
ENV PATH="$PATH:/root/.cargo/bin"
# Add emscripten target
RUN rustup target add asmjs-unknown-emscripten --toolchain $RUST_VERSION && \
rustup target add wasm32-unknown-emscripten --toolchain $RUST_VERSION
# Reset entrypoint (avoid emscripten overwriting PATH)
ENTRYPOINT []
CMD ["cargo", "build", "--release", "--target=asmjs-unknown-emscripten"]