-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (20 loc) · 766 Bytes
/
Dockerfile
File metadata and controls
24 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM rust:1.89-alpine AS chef
USER root
# Add cargo-chef to cache dependencies
RUN apk add --no-cache musl-dev & cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY . .
# Capture info needed to build dependencies
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --bin p2p_solana_handshake --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin p2p_solana_handshake
FROM debian:buster-slim AS runtime
WORKDIR /app
COPY --from=builder /app/target/release/p2p_solana_handshake /usr/local/bin/p2p_solana_handshake
ENTRYPOINT ["/usr/local/bin/p2p_solana_handshake"]