Repository navigation
build/bake: support reproducible timestamps with source-date-epoch - #338
Merged
Merged
Conversation
crazy-max
force-pushed
the
source-date-epoch
branch
2 times, most recently
from
November 5, 2026 15:24
b71c540 to
cf3e239
Compare
tonistiigi
reviewed
Nov 17, 2026
tonistiigi
left a comment
Member
There was a problem hiding this comment.
Should we default to commit in next major release?
|
|
||
| const inpSourceDateEpoch = core.getInput('source-date-epoch'); | ||
| if (inpSourceDateEpoch !== '') { | ||
| core.exportVariable('SOURCE_DATE_EPOCH', inpSourceDateEpoch); |
Member
There was a problem hiding this comment.
What does this env do, especially because we are setting BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP.
Member
Author
There was a problem hiding this comment.
Yes this was an oversight after switching to local vars
| file: test/source-date-epoch.Dockerfile | ||
| build-args: | | ||
| SOURCE_DATE_EPOCH=1 | ||
| EXPECTED_EPOCH=${{ matrix.epoch }} |
Member
There was a problem hiding this comment.
Can we test something that relies on rewrite-timestamps?
Member
Author
There was a problem hiding this comment.
Updated tests to check the actual image file timestamp:
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
crazy-max
force-pushed
the
source-date-epoch
branch
from
November 17, 2026 09:04
cf3e239 to
d34cc15
Compare
tonistiigi
approved these changes
Nov 17, 2026
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.
fixes #307
Add an optional
source-date-epochinput to both workflows to align build output and generated metadata timestamps. It accepts a non-negative Unix timestamp, including zero, orcommitto use the event commit's committer time without a checkout. Image exports enable timestamp rewriting for layer contents, while local exports use BuildKit's built-in timestamp handling. Leaving the input empty preserves existing behavior.Provenance still contains execution-specific data, so final image index digests can differ even when image contents are reproducible.