-
Create docker-machine
$ docker-machine create -d virtualbox --virtualbox-memory=4096 --virtualbox-cpu-count=2 --virtualbox-disk-size=50000 rust-wasm
-
Build
$ cd /path/to/rust-wasm-incoming
$ docker build -t foo .
It takes some time and the size of the image is about 26GB.
$ docker run -it -v `pwd`:/source foo rustc -O --target wasm32-unknown-emscripten bar.rs -o bar.html
$ docker run -it -v `pwd`:/source foo rustc -O --target asmjs-unknown-emscripten bar.rs -o bar.html