Updated docker file for better caching
This commit is contained in:
parent
f8d7807c6c
commit
9ef17f31fe
27
Dockerfile
27
Dockerfile
@ -1,11 +1,18 @@
|
||||
FROM docker.io/rust:alpine as builder
|
||||
WORKDIR /build/pass_manager
|
||||
RUN apk -U upgrade --no-cache && apk add --no-cache musl-dev
|
||||
COPY . .
|
||||
RUN cargo install --path .
|
||||
FROM rust:slim AS chef
|
||||
RUN cargo install cargo-chef
|
||||
WORKDIR /app
|
||||
|
||||
FROM docker.io/alpine
|
||||
WORKDIR /app/
|
||||
RUN apk -U upgrade --no-cache
|
||||
COPY --from=builder /usr/local/cargo/bin/pass_manager .
|
||||
CMD ["./pass_manager"]
|
||||
FROM chef AS planner
|
||||
COPY . .
|
||||
RUN cargo chef prepare
|
||||
|
||||
FROM chef AS builder
|
||||
COPY --from=planner /app/recipe.json recipe.json
|
||||
RUN cargo chef cook --release
|
||||
COPY . .
|
||||
RUN cargo b -r
|
||||
|
||||
FROM debian:buster-slim
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/target/release/pass_manager .
|
||||
CMD [ "./pass_manager" ]
|
||||
|
Loading…
Reference in New Issue
Block a user