From aecd5dbc67035a7f23e8df75c0268149bb289c40 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 23 Nov 2022 08:09:10 +0000 Subject: [PATCH] Use cache mount and install ca-certs. --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f352c8c..d6ebf0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,19 @@ WORKDIR /app/ COPY . . -RUN cargo build --release +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/app/target/ \ + cargo build --release && \ + cp target/release/region-restriction-checker . FROM debian:stable-slim +RUN apt-get update && \ + apt-get install -y ca-certificates && \ + rm -rf /var/lib/apt/lists/* + WORKDIR /app/ -COPY --from=builder /app/target/release/region-restriction-checker . +COPY --from=builder /app/region-restriction-checker . CMD ["/app/region-restriction-checker"]