Skip to content

[Request]: Consistent and useful multi-platform semantics for pull, push, save, load, build. #913

Description

@jglogan

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:

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 --platform option selects a single, specific platform
  • The --all-platforms option selects all platforms

image save and image load

We have two options:

  • Identical semantics as image pull and image 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

  1. added this to the 2025-11 milestone on Nov 21, 2025
  2. added theissue type on Nov 21, 2025
  3. modified the milestones: 2025-11, 2025-12 on Dec 8, 2025
  4. modified the milestones: 2025-12, 2026-01, 2026-02 on Jan 24, 2026
  5. modified the milestones: 2026-02, 2026-03 on Feb 11, 2026
  6. modified the milestones: 2026-04, 2026-05 on Apr 22, 2026
  7. removed this from the 2026-05 milestone on May 5, 2026
  8. SVilgelm commented on Nov 18, 2026

    @SVilgelm

    Data point for image load: on main + #2378 (which makes pull unpack one platform), loading 5 multi-arch images saved from container created 40 snapshots, 6.0 GB for 1.8 GB of content.

  9. SVilgelm commented on Nov 20, 2026

    @SVilgelm

    @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_PLATFORM if set, otherwise the native platform. run, create and build already use it.

    image pull

    • No options: the default platform only, downloaded and unpacked (Pull platform specific containers by default to save bandwidth (by 20x for some images) #83).
    • --platform: that platform.
    • --all-platforms (new): every platform, the current default. Only the default platform is unpacked; other platforms are unpacked on first use, as run --platform already does.
    • An image without the requested platform fails with the platforms it has and the flag to use. Today pull --platform linux/arm64 docker.io/amd64/alpine:3.20 fails with unsupported platform Platform(osVersion: nil, ...) and leaves the image listed.
    • Pulling platform A, then B: B is added to the same image. This already works.

    image push

    • No options: every platform the image has locally. After a default pull that's one platform. After pull --all-platforms or a multi-platform build it'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.
    • This differs from the description, which defaults push to the native platform: with that, build --platform linux/amd64,linux/arm64 then push would push only arm64.

    image save / image load

    • save: the same rule as push. Images pulled with defaults have only the native platform, which covers [Request]: Image save command: 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-platforms unpacks 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/--arch and multiple --platform values: 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. push and save export one platform or all, so an image with some but not all platforms local (pulled for arm64, then amd64) would need --platform or --all-platforms until containerization can export a set of platforms.

    PRs: (1) pull, with the shared platform selection and errors; (2) load and build; (3) push, save and a how-to section. #1426 is left to #1598.

    This builds on #455 by @Sunsvea and #2378 by @CHE3MZ.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions