forked from rh-ecosystem-edge/recert
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (26 loc) · 765 Bytes
/
Dockerfile
File metadata and controls
29 lines (26 loc) · 765 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
26
27
28
29
FROM rust:1 AS chef
RUN cargo install cargo-chef
WORKDIR app
FROM chef AS planner
COPY Cargo.toml Cargo.lock .
COPY src/ src/
COPY vendor/ vendor/
COPY .cargo/ .cargo/
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN apt-get update
RUN apt-get install -y protobuf-compiler
COPY vendor/ vendor/
RUN cargo chef cook --release --recipe-path recipe.json
COPY Cargo.toml Cargo.lock .
COPY .cargo/ .cargo/
COPY src/ src/
COPY build.rs build.rs
RUN cargo build --release --bin recert
FROM docker.io/library/debian:bookworm AS runtime
WORKDIR app
RUN apt-get update
RUN apt-get install -y openssl
COPY --from=builder /app/target/release/recert /usr/local/bin
ENTRYPOINT ["/usr/local/bin/recert"]