Skip to content

engine: add platform field to EngineConfig#669

Open
TrevorBurnham wants to merge 1 commit intocontainers:mainfrom
TrevorBurnham:add-engine-platform-config
Open

engine: add platform field to EngineConfig#669
TrevorBurnham wants to merge 1 commit intocontainers:mainfrom
TrevorBurnham:add-engine-platform-config

Conversation

@TrevorBurnham
Copy link

@TrevorBurnham TrevorBurnham commented Feb 24, 2026

Issue: containers/podman#25641

This PR adds a new platform option to the [engine] section of containers.conf:

[engine]
platform = "linux/amd64"

This allows users to set a default platform (of the form os/arch or os/arch/variant) for image operations.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Thanks
Please make podman and buildah Prs to actually implement that option so we know this will work before merging here.

Also this will have to be document in the default containers.conf file as well not just the mane page

@Luap99
Copy link
Member

Luap99 commented Feb 25, 2026

As a general note the AI PR descriptions add nothing of value so just omit them, simply a short one sentence description with a link to the issue is enough for such a simple change

@TrevorBurnham TrevorBurnham force-pushed the add-engine-platform-config branch from 41047e4 to 625a59a Compare February 25, 2026 15:28
@TrevorBurnham
Copy link
Author

@Luap99 Updated, thanks!

TrevorBurnham added a commit to TrevorBurnham/buildah that referenced this pull request Feb 25, 2026
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>
TrevorBurnham added a commit to TrevorBurnham/podman that referenced this pull request Feb 25, 2026
Closes: containers#25641

Add support for setting a default platform for image operations (pull,
build, create, run) without requiring --platform on every command.

The default platform is resolved in the following priority order:
1. Explicit --platform (or --arch/--os) flag
2. DOCKER_DEFAULT_PLATFORM environment variable
3. containers.conf [engine] platform setting
4. Host's native OS/architecture

This is useful for Apple Silicon users who need linux/amd64 images, and
for Docker compatibility (DOCKER_DEFAULT_PLATFORM).

Depends on: containers/container-libs#669

Signed-off-by: TrevorBurnham <TrevorBurnham@users.noreply.github.com>
Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
@TrevorBurnham
Copy link
Author

Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
@TrevorBurnham TrevorBurnham force-pushed the add-engine-platform-config branch from 625a59a to ebad6b0 Compare February 25, 2026 19:27
TrevorBurnham added a commit to TrevorBurnham/buildah that referenced this pull request Feb 26, 2026
Use go.podman.io/common from TrevorBurnham/container-libs#669
(add-engine-platform-config branch) 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 added a commit to TrevorBurnham/buildah that referenced this pull request Feb 26, 2026
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 added a commit to TrevorBurnham/buildah that referenced this pull request Feb 26, 2026
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>
TrevorBurnham added a commit to TrevorBurnham/buildah that referenced this pull request Feb 26, 2026
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 added a commit to TrevorBurnham/buildah that referenced this pull request Feb 27, 2026
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>
TrevorBurnham added a commit to TrevorBurnham/buildah that referenced this pull request Feb 27, 2026
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>
@TomSweeneyRedHat
Copy link
Member

Noting that the Buildah PR passed CI testing, Podman is still red tests there.

@TomSweeneyRedHat
Copy link
Member

Changes LGTM
Just need to get the Podman tests happy, and then I'd like a final head nod from @Luap99

@mtrmac
Copy link
Contributor

mtrmac commented Feb 27, 2026

(The Podman PR points at a few design questions, at this point I wouldn’t rule out that we might want to change the syntax documented in this PR. But I’l leave that to experts.)

@TrevorBurnham
Copy link
Author

Just need to get the Podman tests happy

I've rebased the branch and all checks for the PR are now passing except one, which appears to be due to a disruption in testing farm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants