Skip to content

Commit e7ba080

Browse files
committed
build: Use normalized platform spec for ARG expansion
The ARG variables for multi-platform builds should use a normalized platform spec. This ensures consistent formatting across different platform string representations, particularly for edge cases like architecture normalization. -- https://github.com/containers/buildah/blob/c97d402ccd8dbc5442c3b9fd952fece3f22fbce4/internal/util/util.go#L44 https://github.com/containers/common/blob/a5ccdae846b629b5ceaefa6ffd5c6511409c3487/libimage/platform/platform.go#L20 Signed-off-by: Michal Šoltis <[email protected]>
1 parent b65ffa9 commit e7ba080

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/commands/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ func (c *Build) parseContainerfile() (*dockerfile.Dockerfile, error) {
556556
func (c *Build) createBuildArgExpander() (dockerfile.SingleWordExpander, error) {
557557
// Define built-in ARG variables
558558
// See https://docs.docker.com/build/building/variables/#multi-platform-build-arguments
559-
platform := platforms.DefaultSpec()
559+
platform := platforms.Normalize(platforms.DefaultSpec())
560560
args := map[string]string{
561561
// We current don't explicitly expose the --platform flag, so the TARGET* values always
562562
// match the BUILD* values. If we add --platform handling, we would want to respect it here.

0 commit comments

Comments
 (0)