mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Which issue # does this PR address? This PR addresses reproducible builds. The current dockerfile builds the lighthouse binary but not reproducibly. You can verify that by following these steps: ``` docker build --no-cache --output=. . mv usr/local/bin/lighthouse lighthouse1 rm usr/local/bin/lighthouse docker build --no-cache --output=. . mv usr/local/bin/lighthouse lighthouse2 sha256sum lighthouse1 lighthouse2 ``` You will notice that each one of the binaries has a different checksum upon each build. This is critical for systems that depends on requiring reproducible builds, such as running lighthouse in confidential computing, like Intel TDX. This PR adds a new build profile as well as a Dockerfile.reproducible that enables building the lighthouse binary reproducibly. By following the steps I listed above, you will be able to verify that the resulted binary has the same hash upon several subsequent builds for the same version. How to test it: ``` mkdir output1 output2 docker build --no-cache -f Dockerfile.reproducible --output=output1 . docker build --no-cache -f Dockerfile.reproducible --output=output2 . sha256sum output1/lighthouse output2/lighthouse # hashes should be identical rm -rf output1 output2 ```
9.8 KiB
9.8 KiB