FROM docker.io/emscripten/emsdk:3.1.46 as builder RUN apt-get update && \ apt-get install -y --no-install-recommends make cmake git && \ apt-get autoremove -y && apt-get clean RUN userdel emscripten -r USER root ENV BUILD_DIR=build-wasm WORKDIR / RUN git clone https://github.com/corwinkuiper/mgba.git --filter=tree:0 -b wasm RUN mkdir /mgba/build-wasm WORKDIR /mgba/build-wasm RUN git checkout 26a2701cef6fcad47c67559fcb7892004f8d489c RUN emcmake cmake .. && make install DESTDIR=install FROM scratch COPY --from=builder /mgba/build-wasm/wasm/mgba.js . COPY --from=builder /mgba/build-wasm/wasm/mgba.wasm . COPY --from=builder /mgba/build-wasm/wasm/mgba.d.ts .