diff --git a/tests/js/README.md b/tests/js/README.md index 5e198eca7..bf66b54bb 100644 --- a/tests/js/README.md +++ b/tests/js/README.md @@ -265,6 +265,13 @@ Make sure that the wasm file is in the `public` directory. Reference: [emscripten/#10114](https://github.com/emscripten-core/emscripten/issues/10114) +### Compile in docker +Instead of installing emscripten natively you can also run the compilation in docker from this directory using e.g. + +```bash +DOCKER_USER=$(id -u):$(id -g) docker compose run --rm emscripten make -f Makefile_js build es6=yes +``` + ## Instructions to run the tests ```bash npm install diff --git a/tests/js/docker-compose.yml b/tests/js/docker-compose.yml new file mode 100644 index 000000000..ed3ecc3a6 --- /dev/null +++ b/tests/js/docker-compose.yml @@ -0,0 +1,15 @@ +version: "3.7" + +services: + # https://github.com/emscripten-core/emsdk/blob/main/docker/README.md + emscripten: + image: emscripten/emsdk:1.39.16 + # Allow writing to host filesystem as non-root + user: ${DOCKER_USER:-1000:1000} + working_dir: /app/src + volumes: + - ../..:/app + - emscripten-cache:/emsdk/upstream/emscripten/cache + +volumes: + emscripten-cache: