-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
459a32e
commit 6298f95
Showing
1 changed file
with
5 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
# build stage | ||
FROM rust:bookworm as build | ||
FROM rust:bullseye as builder | ||
|
||
RUN apt-get update && apt-get install -y libssl-dev ca-certificates cmake git | ||
|
||
# create a new empty shell project | ||
RUN USER=root cargo new --bin legba | ||
WORKDIR /legba | ||
|
||
# copy contents | ||
COPY ./Cargo.lock ./Cargo.lock | ||
COPY ./Cargo.toml ./Cargo.toml | ||
COPY ./src ./src | ||
|
||
# build | ||
WORKDIR /app | ||
ADD . /app | ||
RUN cargo build --release | ||
|
||
FROM debian:bookworm-slim | ||
RUN apt-get update && apt-get install -y libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/* | ||
RUN update-ca-certificates | ||
COPY --from=build /legba/target/release/legba /usr/bin/legba | ||
FROM gcr.io/distroless/cc-debian11 | ||
COPY --from=builder /app/target/release/legba /usr/bin/legba | ||
ENTRYPOINT ["/usr/bin/legba"] |