1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01:00
programming-challenges/templates/docker/rust/Dockerfile

17 lines
477 B
Docker
Raw Normal View History

2024-11-18 01:04:51 +01:00
FROM rust:1.82.0 AS builder
2022-12-30 00:55:21 +01:00
WORKDIR /usr/src/rust_application
2022-12-30 00:55:21 +01:00
# Cache dependencies
RUN cargo init --bin ./
COPY ./Cargo.* ./
RUN cargo build --release && rm --recursive --force ./src ./target/release/deps/rust_application*
2022-12-30 00:55:21 +01:00
# Build application
COPY ./ ./
RUN cargo build --release
2023-09-16 14:38:47 +02:00
FROM gcr.io/distroless/cc-debian12:latest AS runner
2022-12-30 00:55:21 +01:00
WORKDIR /usr/src/rust_application
COPY --from=builder /usr/src/rust_application/target/release/rust_application ./
CMD ["./rust_application"]