Support reproducible builds (except packages)#915
Closed
AkihiroSuda wants to merge 1 commit into
Closed
Conversation
See docker-library/official-images issue 16044 - `SOURCE_DATE_EPOCH` is added. The value is consumed by the build scripts to make the binary reproducible. - For Debian, `/var/log/*` is removed as they contain timestamps - For Debian, `/var/cache/ldconfig/aux-cache` is removed as they contain inode numbers, etc. - For Alpine, virtual package versions are pinned to "0" to eliminate the timestamp-based version numbers that appear in `/etc/apk/world` and `/lib/apk/db/installed` - For Alpine, `/var/cache/fontconfig` is removed > [!NOTE] > The following topics are NOT covered by this commit: > > - To reproduce file timestamps in layers, BuildKit has to be executed with > `--output type=<TYPE>,rewrite-timestamp=true`. > Needs BuildKit v0.13 or later. > > - To reproduce the base image by the hash, reproducers may: > - modify the `FROM` instruction in Dockerfile manually > - or, use the `CONVERT` action of source policies to replace the base image. > <https://github.com/moby/buildkit/blob/v0.13.2/docs/build-repro.md> > > - To reproduce packages, see the `RUN` instruction hook proposed in > moby/buildkit issue 4576 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See:
SOURCE_DATE_EPOCHis added. The value is consumed by the build scripts to make the binary reproducible.For Debian,
/var/log/*is removed as they contain timestampsFor Debian,
/var/cache/ldconfig/aux-cacheis removed as they contain inode numbers, etc.For Alpine, virtual package versions are pinned to "0" to eliminate the timestamp-based version numbers that appear in
/etc/apk/worldand/lib/apk/db/installedFor Alpine,
/var/cache/fontconfigis removedNote
The following topics are NOT covered by this commit:
To reproduce file timestamps in layers, BuildKit has to be executed with
--output type=<TYPE>,rewrite-timestamp=true.Needs BuildKit v0.13 or later.
To reproduce the base image by the hash, reproducers may:
FROMinstruction in Dockerfile manuallyCONVERTaction of source policies to replace the base image.https://github.com/moby/buildkit/blob/v0.13.2/docs/build-repro.md
To reproduce packages, see the
RUNinstruction hook proposed inProposal: hooks for
RUNinstructions (use cases: reproducible builds, cross-compilation, malware detection, ...) moby/buildkit#4576