From a85d27f9a4fbd6d5510bcffcce9cb7780fcc44a2 Mon Sep 17 00:00:00 2001 From: hexlocation pc Date: Sat, 13 Jul 2024 00:47:51 +0200 Subject: [PATCH] fix: docker building --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 890fc4f..1bbc441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,21 @@ FROM rust:1.79 as compile WORKDIR /build COPY . . + +RUN rustup target add x86_64-unknown-linux-musl + RUN rm -Rf /build/Cargo.lock RUN cargo update RUN cargo build --release -FROM gcr.io/distroless/static-debian12 +RUN ls /build/target + +FROM gcr.io/distroless/cc WORKDIR /app -COPY --from=compile /build/target/release/iwakura-web /bin/server +COPY --from=compile /build/target/release/iwakura-web /app/ COPY --from=compile /build/assets /app/assets -CMD ["/bin/server"] +COPY --from=compile /build/templates /app/templates + +CMD ["/app/iwakura-web"]