Using Docker multi-stage builds to produce WebAssembly

Some time ago I decided to start a fun project, the Wheel of WebAssembly, to demonstrate how different programming languages can be compiled to WebAssembly and loaded independently on the same web page. It supports languages like C, AssemblyScript, C#, Java, Kotlin, Go, Rust (I call them wheel parts). Initially, I decided to manually configure the toolchain for each programming language on my machine and then compile them altogether. This worked fine for a while, but with time it became complicated to handle updates for each toolchain. Furthermore, when someone else wanted to play around with the project, they had to go through the same pain of manually configuring their environment. This lead me to start using Docker for building the WebAssembly output for each language. Continue Reading…