File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM rust as planner
2+ WORKDIR app
3+ # We only pay the installation cost once,
4+ # it will be cached from the second build onwards
5+ # To ensure a reproducible build consider pinning
6+ # the cargo-chef version with `--version X.X.X`
7+ RUN cargo install cargo-chef
8+
9+ COPY . .
10+
11+ RUN cargo chef prepare --recipe-path recipe.json
12+
13+ FROM rust as cacher
14+ WORKDIR app
15+ RUN cargo install cargo-chef
16+ COPY --from=planner /app/recipe.json recipe.json
17+ RUN --mount=type=ssh cargo chef cook --release --recipe-path recipe.json
18+
19+ FROM rust as builder
20+ WORKDIR app
21+ COPY . .
22+ # Copy over the cached dependencies
23+ COPY --from=cacher /app/target target
24+ COPY --from=cacher /usr/local/cargo /usr/local/cargo
25+ RUN --mount=type=ssh cargo build --release --bin reporting
26+
27+ FROM debian:buster-slim as runtime
28+ WORKDIR app
29+ COPY --from=builder /app/target/release/reporting /usr/local/bin
30+ RUN apt-get update && apt-get -y install ca-certificates libssl-dev && rm -rf /var/lib/apt/lists/*
31+ ENTRYPOINT ["/usr/local/bin/reporting" ]
You can’t perform that action at this time.
0 commit comments