Use cache mount and install ca-certs.

This commit is contained in:
Kavin 2022-11-23 08:09:10 +00:00
parent 29980d0f60
commit aecd5dbc67
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -4,12 +4,19 @@ WORKDIR /app/
COPY . . 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 FROM debian:stable-slim
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app/ WORKDIR /app/
COPY --from=builder /app/target/release/region-restriction-checker . COPY --from=builder /app/region-restriction-checker .
CMD ["/app/region-restriction-checker"] CMD ["/app/region-restriction-checker"]