Relationships
#3683 @swamp/container-image: platform input on build; Apple Containers can build multi-platform
Opened by dmc · 10/20/2026· Shipped 10/22/2026
Problem
Two related gaps make it hard to build for a non-host platform:
buildcannot choose a platform.BuildArgsSchemahas noplatformfield, andbuildBuildArgvnever adds--platform, sobuildalways targets the host architecture. On an Apple-silicon Mac,buildcannot produce a single-archlinux/amd64image with any runtime.multi-platform-buildblocks Apple Containers based on an outdated premise. Themulti-platform-availablecheck (and the README matrix) says Apple Containers "can only build for the host architecture (arm64) — it has no cross-compilation support for multi-platform manifests". That is no longer true. Tested with Applecontainer1.5.0 (Homebrew, macOS 26, Apple silicon):container build --platform linux/amd64 …→ alinux/amd64image (Rosetta).container build --platform linux/amd64 --platform linux/arm64 -t multi-test:platform .→ one image index with bothlinux/amd64andlinux/arm64. Running each variant: amd64 →uname -m=x86_64, arm64 →aarch64.container build --arch amd64 --arch arm64 …→ the same two-platform index.container build --help:--platform <platform> Add the platform to the build (format: os/arch[/variant] …) [environment: CONTAINER_DEFAULT_PLATFORM].
Not tested: whether
container image pushpushes the whole multi-platform index.
Use case: building a bootc OS image (FROM quay.io/centos-bootc/centos-bootc:stream10) for x86_64 Proxmox VMs from an arm64 laptop with binary: container.
Current workaround: run swamp with CONTAINER_DEFAULT_PLATFORM=linux/amd64 in the environment. The extension passes the environment through, and oci-build::build then produces linux/amd64. This works, but it applies to the whole swamp process, not to one step, so it does not fit a workflow that builds for more than one platform.
Proposed solution
build: add an optionalplatform.BuildArgsSchema:platform: safeOptionValue("platform").optional().describe("Target platform (e.g. 'linux/amd64'). Defaults to the host platform.")buildBuildArgv:if (args.platform) argv.push("--platform", args.platform);—docker build,podman buildandcontainer buildall accept--platform os/arch.BuildResultSchema: addplatform: z.string().optional().- No behavior change when
platformis omitted.
multi-platform-build: supportbinary: container.- Allow
containerincheckBuildxAvailable. - Argv:
container buildwith one--platform <p>per entry inplatforms,-t <tag>per tag, thencontainer image push <tag>whenpushis true (checking that the pushed digest is the index digest). - Update the README runtime matrix and the method description ("Not available for Apple Containers").
- Allow
Alternatives considered
- A local
export const extensioncannot add an input tobuild: the base type's own member always wins. - A new method name (e.g.
build-for-platform) duplicates the build argv code. CONTAINER_DEFAULT_PLATFORM: works for one platform per process only (see above).
Environment
@swamp/container-image2026.10.13.1 (model 2026.08.25.2)- swamp 20261016.142354.0
- Apple
container1.5.0 (Homebrew), macOS 26, Apple silicon
Upstream repository: https://github.com/swamp-club/swamp-extensions
Environment
- Extension:
@swamp/container-image@2026.10.13.1 - swamp:
20261020.171730.0-sha.f469323c - OS:
darwin(aarch64) - Deno:
2.9.7 - Shell:
/bin/zsh
Shipped
Click a lifecycle step above to view its details.
system commented 10/20/2026, 7:21:24 PM
Classified automatically when this issue was filed.
- Source: Extensions
If you feel this classification is incorrect, add a ripple to tell us so.
stack72 commented 10/22/2026, 1:23:32 AM
Thanks @dmc for reporting this! We shipped: Add an optional platform input to build (emits --platform, recorded in buildResult, passed through to docker OCI export) and let multi-platform-build run with Apple Containers via container build with repeated --platform flags plus container image push per tag. Lift the outdated host-arch-only block in checkBuildxAvailable and defaultBuildxProbe, update docs, bump versions.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.