Disable wasmtime cache in the Docker image

This commit is contained in:
Quentin Gliech
2022-08-08 16:23:50 +02:00
parent c1e0f84953
commit 8fd4f3d658
2 changed files with 14 additions and 0 deletions

View File

@@ -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"]

View File

@@ -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