From bfdfd61656a80a772ffc2bfed1018e04700e6f27 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 10 Sep 2020 16:14:40 -0700 Subject: [PATCH] Fix sanity file generation in Dockerfile (#610) We no longer ship the sanify file as part of the SDK but expect it be generated on first use: https://github.com/WebAssembly/waterfall/pull/656 Also remove the Dockerfile itself from the docker image if we include it then whenever you change anything in the Dockerfile it invalides all the layers and forces a completely rebuild. This makes iterating on the image very slow. --- .dockerignore | 3 --- docker/Dockerfile | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 0e32b67..e7bc7c3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,9 +4,6 @@ # Allow to run the test script inside the Docker container !/docker/test_dockerimage.sh -# Allow the Dockerfile for future re-creation/reference -!/docker/Dockerfile - # Ignore unnecessary files inside top-level directory *.bat *.csh diff --git a/docker/Dockerfile b/docker/Dockerfile index e183c21..f58c5ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,11 +28,15 @@ RUN echo "## Install Emscripten" \ && echo "## Done" # This generates configuration that contains all valid paths according to installed SDK +# TODO(sbc): We should be able to use just emcc -v here but it doesn't +# currently create the sanity file. RUN cd ${EMSDK} \ && echo "## Generate standard configuration" \ && ./emsdk activate ${EMSCRIPTEN_VERSION} \ && chmod 777 ${EMSDK}/upstream/emscripten \ && chmod -R 777 ${EMSDK}/upstream/emscripten/cache \ + && echo "int main() { return 0; }" > hello.c \ + && ${EMSDK}/upstream/emscripten/emcc -c hello.c \ && cat ${EMSDK}/upstream/emscripten/cache/sanity.txt \ && echo "## Done"