From 8fd4f3d658090f0e9d8859ddbaf5aedbbddac0b0 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 8 Aug 2022 16:23:50 +0200 Subject: [PATCH] Disable wasmtime cache in the Docker image --- Dockerfile | 10 ++++++++++ misc/wasmtime-config.toml | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 misc/wasmtime-config.toml diff --git a/Dockerfile b/Dockerfile index d310f5eca..931ac642b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -132,12 +132,22 @@ RUN mv target/$(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}")/release/mas- ## Runtime stage, debug variant ## FROM --platform=${TARGETPLATFORM} gcr.io/distroless/cc-debian${DEBIAN_VERSION}:debug-nonroot AS debug + +# Inject a wasmtime config which disables cache to avoid issues running with a read-only root filesystem +ENV XDG_CONFIG_HOME=/etc +COPY ./misc/wasmtime-config.toml /etc/wasmtime/config.toml + COPY --from=builder /usr/local/bin/mas-cli /usr/local/bin/mas-cli WORKDIR / ENTRYPOINT ["/mas-cli"] ## Runtime stage ## FROM --platform=${TARGETPLATFORM} gcr.io/distroless/cc-debian${DEBIAN_VERSION}:nonroot + +# Inject a wasmtime config which disables cache to avoid issues running with a read-only root filesystem +ENV XDG_CONFIG_HOME=/etc +COPY ./misc/wasmtime-config.toml /etc/wasmtime/config.toml + COPY --from=builder /usr/local/bin/mas-cli /usr/local/bin/mas-cli WORKDIR / ENTRYPOINT ["/usr/local/bin/mas-cli"] diff --git a/misc/wasmtime-config.toml b/misc/wasmtime-config.toml new file mode 100644 index 000000000..d390f110c --- /dev/null +++ b/misc/wasmtime-config.toml @@ -0,0 +1,4 @@ +# Disable wasmtime cache by default in the Docker image, because the rootfs is likely to be read-only + +[cache] +enabled = false