Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add reproducible build profile and Dockerfile #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MoeMahhouk
Copy link

This PR adds a reproducible build profile and a Dockerfile that will build the binary reproducibly and puts it in a distroless minimal base image.
This will later be used in the BuilderNet v1.3 where most services will run in containers.

Steps to test:

mkdir output1 output2
docker build --no-cache --output=output1 .
docker build --no-cache --output=output2 . 
sha256sum output1/rbuilder output2/rbuilder
# hashes should be identical
rm -rf output1 output2 

@ZanCorDX
Copy link
Collaborator

ZanCorDX commented Jan 14, 2025

I see you don't use release defaults (https://doc.rust-lang.org/cargo/reference/profiles.html):

[profile.release]
opt-level = 3
debug = false
split-debuginfo = '...'  # Platform-specific.
strip = "none"
debug-assertions = false
overflow-checks = false
lto = false
panic = 'unwind'
incremental = false
codegen-units = 16
rpath = false

I'm worried about behavior change. Are you 100% sure about each item? eg: overflow-checks, panic.

@metachris
Copy link

agree with vitaly about there being a bunch of items. imo the fewer changes the better! which ones are absolutely necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants