mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
build(deps): update latest
This commit is contained in:
1
templates/docker/rust/.dockerignore
Normal file
1
templates/docker/rust/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
/target
|
@ -1,7 +1,16 @@
|
||||
FROM rust:1.64.0
|
||||
FROM rust:1.66.0 AS builder
|
||||
WORKDIR /usr/src/rust_application
|
||||
|
||||
WORKDIR /usr/app
|
||||
COPY ./ /usr/app
|
||||
RUN rustc -C debuginfo=0 -C opt-level=3 -C target-cpu=native solution.rs
|
||||
# Cache dependencies
|
||||
RUN cargo init --bin ./
|
||||
COPY ./Cargo.* ./
|
||||
RUN cargo build --release && rm --recursive --force ./src ./target/release/deps/rust_application*
|
||||
|
||||
CMD ["./solution"]
|
||||
# Build application
|
||||
COPY ./ ./
|
||||
RUN cargo build --release
|
||||
|
||||
FROM gcr.io/distroless/cc-debian11:latest AS runner
|
||||
WORKDIR /usr/src/rust_application
|
||||
COPY --from=builder /usr/src/rust_application/target/release/rust_application ./
|
||||
CMD ["./rust_application"]
|
||||
|
Reference in New Issue
Block a user