From cc00f62187d08e560fc488f01cd2768095a1abc6 Mon Sep 17 00:00:00 2001 From: Lorenzo Venerandi Date: Wed, 21 Aug 2024 12:18:17 +0200 Subject: [PATCH] two phase dockerfile --- wasm-container-runtime/Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 wasm-container-runtime/Dockerfile diff --git a/wasm-container-runtime/Dockerfile b/wasm-container-runtime/Dockerfile new file mode 100644 index 0000000..75c89a1 --- /dev/null +++ b/wasm-container-runtime/Dockerfile @@ -0,0 +1,12 @@ +# Build phase +FROM emscripten/emsdk AS build +RUN mkdir -p /build +WORKDIR /build +COPY src ./src +RUN emcc ./src/main.c -o ./main.wasm +RUN chmod a+x ./main.wasm + +# Run phase +FROM scratch +COPY --from=build /build/main.wasm /main.wasm +ENTRYPOINT [ "/main.wasm" ] \ No newline at end of file