Skip to content

dockerfile: normalize platform in image config #5776

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
Feb 26, 2025

Conversation

tonistiigi
Copy link
Member

Base image may use unnormalized platform so if platform is inherited normalize needs to be called again.

OCI  specs lib could also do it in MarshalJSON.

fix #5774

changed in #5714

Base image may use unnormalized platform so if platform
is inherited normalize needs to be called again.

Signed-off-by: Tonis Tiigi <[email protected]>
@@ -815,6 +815,7 @@ func toDispatchState(ctx context.Context, dt []byte, opt ConvertOpt) (*dispatchS
target.image.OSFeatures = append([]string{}, platformOpt.targetPlatform.OSFeatures...)
}
}
target.image.Platform = platforms.Normalize(target.image.Platform)
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a test?

Copy link
Member Author

Choose a reason for hiding this comment

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

This expects a base image not created by buildkit, so not easily.

@AkihiroSuda AkihiroSuda merged commit 6824fcf into moby:master Feb 26, 2025
105 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.

Buildkit 0.20.0 may add a "variant" field, which alters the image digest
5 participants