-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (18 loc) · 703 Bytes
/
Dockerfile
File metadata and controls
22 lines (18 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
WORKDIR /share-music
FROM chef AS planner
# prepare dependencies for caching
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
# build project dependencies
COPY --from=planner /share-music/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
# build project
COPY . .
RUN cargo build --release --bin share-music
FROM gcr.io/distroless/cc-debian12 as runtime
# copy missing dynamic libraries
COPY --from=chef --chown=root:root /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=builder /share-music/target/release/share-music /share-music
ENTRYPOINT ["./share-music"]