-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
36 lines (31 loc) · 1.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM lukemathwalker/cargo-chef:latest-rust-1.58.1 as chef
WORKDIR /jinshu
RUN apt update && apt install cmake -y
RUN rustup component add rustfmt
FROM chef as planner
COPY . .
# Compute a lock-like file for our project
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
MAINTAINER "Geng Teng"
COPY --from=planner /jinshu/recipe.json recipe.json
# Build our project dependencies, not our application!
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
# Build our project
RUN cargo build --release --all-targets --examples
FROM debian:bullseye-slim AS target
WORKDIR /jinshu
COPY --from=builder /jinshu/target/release/jinshu-comet .
COPY --from=builder /jinshu/target/release/jinshu-authorizer .
COPY --from=builder /jinshu/target/release/jinshu-receiver .
COPY --from=builder /jinshu/target/release/jinshu-pusher .
COPY --from=builder /jinshu/target/release/jinshu-storage .
COPY --from=builder /jinshu/target/release/jinshu-timer .
COPY --from=builder /jinshu/target/release/jinshu-gateway .
COPY --from=builder /jinshu/target/release/jinshu-api .
COPY --from=builder /jinshu/target/release/jinshu-file .
COPY --from=builder /jinshu/target/release/jinshu-admin .
COPY --from=builder /jinshu/target/release/examples/app-server .
COPY --from=builder /jinshu/target/release/examples/app-client .
COPY --from=builder /jinshu/conf conf