-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (21 loc) · 775 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (21 loc) · 775 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
25
# Stage 1: Planner
FROM lukemathwalker/cargo-chef:latest-rust-1.94.1 AS planner
WORKDIR /app
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
# Stage 2: Builder
FROM lukemathwalker/cargo-chef:latest-rust-1.94.1 AS builder
WORKDIR /app
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching layer
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin secparse-cli
# Stage 3: Runtime
FROM debian:bookworm-slim AS runtime
WORKDIR /app
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/secparse-cli /usr/local/bin/secparse-cli
# Default entrypoint for the CLI
ENTRYPOINT ["secparse-cli"]