Repository navigation
Description
Feature or enhancement request details
We've had #455 open to address #83 for quite a while now. Before we merge it (and celebrate that Alpine doesn't take a minute to pull) we wanted to make sure that we settle on the semantics for the multi-platform UX for all the image store operations.
This issue will be the umbrella for the whole of the work. We can close it once everything's merged / closed:
- Pull platform specific containers by default to save bandwidth (by 20x for some images) #83
- Consistent, useful multi-platform semantics for
image push - Consistent, useful multi-platform semantics for
image save - Consistent, useful multi-platform semantics for
image load - Consistent, useful multi-platform semantics for
build - [Bug]: Image save error output is too low-level. #874 (we can close and include in the
image saveissue once we've defined what we want) - [Request]:
Image savecommand: platform default to current #712 (we can close and include in theimage saveissue once we've defined what we want) - [Request]: Choose platform with CONTAINER_DEFAULT_PLATFORM. #1252 (supports amd64-only development workflow)
- [Request]:
container image loadcannot load legacy Docker tarfiles created by the Google Jib Gradle plugin. #1426 (convert legacydocker saveimages) - [Bug]:
container image loaddoesn't work withdocker image save(containerd snapshotter). #2383 (fixcontainer image loadfor images with sparse content) - Complete a how-to.md section that summarizes how multi-platform works
Let's discuss alternatives here. We're taking "consistent" means something that's simple and easy to reason about while avoiding foolish consistency, and "useful" to mean something that avoids surprises and works well for the most common use cases.
We suppose that the most common use case is a development loop using native (arm64) containers.
However, we should be able to support an amd64-only development loop. You would use this if you're building and pushing your cloud deployment images on your local system (instead of using a CI system that builds/pushes amd64 or amd64+arm64), or if you really need to validate amd64 operation locally full time.
image pull and image push
Pull and push semantics are informed by #83:
- Without any options, the commands use the native platform (
linux/arm64) - The
--platformoption selects a single, specific platform - The
--all-platformsoption selects all platforms
image save and image load
We have two options:
- Identical semantics as
image pullandimage push - Default to saving and loading all platforms, instead of native
The former is definitely more consistent. Is the latter more useful?
- Time to read/write multi-platform archives is less of an issue.
- It may make more sense to write all platforms by default because if a user built a multi-platform image, they've indicated an intention that maybe we shouldn't undo on a
save.
amd64 only development
For the amd64-only development loop, the proposal is to use an environment variable CONTAINER_DEFAULT_PLATFORM that functions similarly to DOCKER_DEFAULT_PLATFORM which if defined, overrides the native platform as the default for pull, push, build, create, and run.
--os and --arch
The -os and --arch shortcuts continue to function as they do today.
Multiple platform selection
The --platform only selects a single platform for all commands except build, but in the future we can consider allowing multiple platform selection for all commands.
Clear error reporting
We'll be replacing messages like these with errors that clearly indicate how platform options need to be modified to fix the issue
Error: notFound: "Content with digest sha256:6e7b17d6343f82de4aacb5687ded76f57aedf457e2906011093d98dfa4d11db4"Containerization considerations
Containerization stores the complete remote image index regardless of pull qualifiers.
TODO - discuss how this works for:
- pull -> push
- pull platform A -> pull platform B
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
Add fallback to CONTAINER_DEFAULT_PLATFORM for image architecture (#1286
Add Apple container build backend for Apple Silicon
Add fallback to CONTAINER_DEFAULT_PLATFORM for image architecture (ap…
Default image pulls to the platform a service will run
SVilgelm commentedon Nov 18, 2026
Data point for
image load: on main + #2378 (which makespullunpack one platform), loading 5 multi-arch images saved fromcontainercreated 40 snapshots, 6.0 GB for 1.8 GB of content.SVilgelm commentedon Nov 20, 2026
@jglogan, a proposal to settle these semantics so #83 can move forward (#455 has stalled and #2378 was closed). If it looks right, I'll implement it in a few PRs.
Default platform:
CONTAINER_DEFAULT_PLATFORMif set, otherwise the native platform.run,createandbuildalready use it.image pull--platform: that platform.--all-platforms(new): every platform, the current default. Only the default platform is unpacked; other platforms are unpacked on first use, asrun --platformalready does.pull --platform linux/arm64 docker.io/amd64/alpine:3.20fails withunsupported platform Platform(osVersion: nil, ...)and leaves the image listed.image pushpull --all-platformsor a multi-platformbuildit's the whole index, unchanged, so pull → tag → push of a multi-platform image keeps its digest (@adityaramani's case on fix: Pull platform-specific container images by default #455).--platform: that platform.--all-platforms: the whole index; fails if a platform is missing locally, naming it and how to fetch it.build --platform linux/amd64,linux/arm64thenpushwould push only arm64.image save/image loadsave: the same rule as push. Images pulled with defaults have only the native platform, which covers [Request]:Image savecommand: platform default to current #712, and multi-platform builds are saved whole. Today a partially pulled image can't be saved without--platform:Error: content with digest sha256:6243….load: imports what the archive contains and unpacks only the default platform, or--platform;--all-platformsunpacks all. Today it unpacks every platform (5 images, 40 snapshots, above).build: unchanged, except that after a multi-platform build only the default platform is unpacked.--os/--archand multiple--platformvalues: as in the description.Errors: a missing platform is reported by name, e.g.
alpine:3.20 has no local content for linux/amd64; pull it with --platform linux/amd64 or --all-platforms, instead of a digest.Containerization: no change needed, with one gap.
pushandsaveexport one platform or all, so an image with some but not all platforms local (pulled for arm64, then amd64) would need--platformor--all-platformsuntil containerization can export a set of platforms.PRs: (1)
pull, with the shared platform selection and errors; (2)loadandbuild; (3)push,saveand a how-to section. #1426 is left to #1598.This builds on #455 by @Sunsvea and #2378 by @CHE3MZ.