Dockerfile for WebAssembly Backend

Don’t know if this has been done recently. I saw the attempt by @aratamizuki but I couldn’t get it to build as the final step failed when copying files from the first stage.

This creates a larger image (about 1GB) but I might be able to optimize it further.

It exposes wasm32-wasi-ghc and wasm32-wasi-cabal, which can be used to build projects with the target being a wasm module.

I’ve successfully used this to build wasm modules in GitLab CI pipelines by pushing the image to the container repository and using it in build scripts.

7 Likes