Skip to content

Use containers.conf engine.platform as default platform#6698

Draft
TrevorBurnham wants to merge 2 commits intocontainers:mainfrom
TrevorBurnham:engine-default-platform
Draft

Use containers.conf engine.platform as default platform#6698
TrevorBurnham wants to merge 2 commits intocontainers:mainfrom
TrevorBurnham:engine-default-platform

Conversation

@TrevorBurnham
Copy link

@TrevorBurnham TrevorBurnham commented Feb 25, 2026

Depends on: containers/container-libs#669

What type of PR is this?

/kind feature

What this PR does / why we need it:

When no --platform, --os, --arch, or --variant flags are specified, fall back to the platform value from containers.conf [engine] section.

How to verify it

  1. Set a non-native platform in containers.conf
  2. Run a pull without using the --platform flag

For example:

# containers.conf
[engine]
platform = "linux/s390x"
buildah pull alpine
buildah inspect --format '{{.OCIv1.Architecture}}' alpine

Expect: s390x

Which issue(s) this PR fixes:

Related to containers/podman#25641

Does this PR introduce a user-facing change?

Yes:

Buildah now respects the `platform` setting in the `[engine]` section of `containers.conf`. Explicit `--platform`, `--os`, `--arch`, or `--variant` flags continue to take precedence.

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@nalind
Copy link
Member

nalind commented Feb 25, 2026

Try adding this to the end of the top-level go.mod:

replace (
	go.podman.io/storage => github.com/TrevorBurnham/container-libs/storage add-engine-platform-config
	go.podman.io/image/v5 => github.com/TrevorBurnham/container-libs/image/v5 add-engine-platform-config
	go.podman.io/common => github.com/TrevorBurnham/container-libs/common add-engine-platform-config
)

followed by a go mod tidy && go mod vendor to pull in the changes from container-libs.

@TrevorBurnham TrevorBurnham force-pushed the engine-default-platform branch 2 times, most recently from 1f24824 to 6219a24 Compare February 26, 2026 23:49
When no --platform, --os, --arch, or --variant flags are specified,
fall back to the platform value from containers.conf [engine] section.
This allows users to set a default platform for all image operations
(pull, build, from) without passing flags each time.

Depends on: containers/container-libs#669

Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
Replace go.podman.io/common, go.podman.io/image/v5, and
go.podman.io/storage with TrevorBurnham/container-libs@add-engine-platform-config
to test the new engine platform config field in buildah CI.

Depends on: containers/container-libs#669

Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
@TrevorBurnham TrevorBurnham force-pushed the engine-default-platform branch from 6219a24 to a336f70 Compare February 27, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants