Skip to content

dockerfile: fix created time taken from base image if named context used #6096

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

Merged
merged 1 commit into from
Jul 21, 2025

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Jul 18, 2025

Fixes #6098

Created time for returned image config should be nil, and gets reset to the timestamp of last layer created during build in the exporter.

This was the case when using base images from registry but was not the case when base image was replaced with the named context.

Created time for returned image config should be nil, and gets reset
to the timestamp of last layer created during build in the exporter.

This was the case when using base images from registry but was not
the case when base image was replaced with the named context.

Signed-off-by: Tonis Tiigi <[email protected]>
@@ -484,8 +484,7 @@ func toDispatchState(ctx context.Context, dt []byte, opt ConvertOpt) (*dispatchS
d.dispatched = true
d.state = *st
if img != nil {
// timestamps are inherited as-is, regardless to SOURCE_DATE_EPOCH
// https://github.com/moby/buildkit/issues/4614
img.Created = nil
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkihiroSuda This comment was from #4663 . Iiuc created time needs to be only maintained for d.baseImg .

@bentekkie
Copy link

Fixes #6098

@crazy-max crazy-max added this to the v0.24.0 milestone Jul 21, 2025
@tonistiigi tonistiigi merged commit 0c01580 into moby:master Jul 21, 2025
140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Created time not populated correctly if base image comes from local oci-layout
3 participants