-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add reproducible build profile and Dockerfile (#42)
* feat: Add reproducible build profile and Dockerfile * remove the extra Cargo.toml profiles * Add comments to the rust flags * feat: add extra job for the reproducible docker build in the CI (#43) * feat: add extra job for the reproducible docker build in the CI * remove the extra Cargo.toml profiles * add comments to the rust flags and move them into Makefile * Add comments to the rust flags * refactor the comments position * chore: re-use the build logic and setup from the makefile * remove unnecessary flags * Revert "remove unnecessary flags" This reverts commit 1977afb. * remove static linking of libgcc
- Loading branch information
1 parent
774438f
commit 260b67e
Showing
3 changed files
with
118 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM rust:1.82-bullseye@sha256:c42c8ca762560c182ba30edda0e0d71a8604040af2672370559d7e854653c66d AS builder | ||
|
||
ARG BUILD_PROFILE=release | ||
ENV BUILD_PROFILE=$BUILD_PROFILE | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libclang-dev=1:11.0-51+nmu5 \ | ||
protobuf-compiler=3.12.4-1+deb11u1 | ||
|
||
# Clone the repository at the specific branch | ||
WORKDIR /app | ||
COPY ./ /app | ||
|
||
# Build the project with the reproducible settings | ||
RUN make build-reproducible | ||
|
||
RUN mv /app/target/x86_64-unknown-linux-gnu/"${BUILD_PROFILE}"/rbuilder /rbuilder | ||
|
||
FROM gcr.io/distroless/cc-debian12:nonroot-6755e21ccd99ddead6edc8106ba03888cbeed41a | ||
COPY --from=builder /rbuilder /rbuilder | ||
ENTRYPOINT [ "/rbuilder" ] |
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