apple / apple/container

[Request]: Describe the available platforms when an image has no variant for the requested one

Open
#2,232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### Feature or enhancement request details

Reopening #2229 as an enhancement request, following the feedback there.

### Description

Running an image that only ships linux/amd64 fails with `Error: platform linux/arm64`. This message gives no clue if the image hasn't arm64 variant, which platforms it does have, or that `--arch amd64` / `--platform linux/amd64` makes it run under Rosetta.

For example, when I run
```
MH='mailhog/mailhog:v1.0.1@sha256:8d76a3d4ffa32a3661311944007a415332c4bb855657f4f6c57996405c009bea'
container image pull "$MH"
container run -d --name mh -p 8025:8025 "$MH"
```

I get the following message: `"Error: platform linux/arm64"`

But I was expecting something more meaningful like `"image docker.io/mailhog/mailhog@sha256:8d76... has no linux/arm64 variant (available: linux/amd64). Use --arch amd64 or --platform linux/amd64 to run it with Rosetta."`

Therefore, instead of returning a bare message, it could be enhanced to list the platforms it actually has and mention the flag that works.

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

No source file or test is named in the issue. Start by tracing the container run platform-validation error and how image manifest platforms are read; done means the failure identifies the missing platform, lists available platforms, and mentions the applicable --arch or --platform option, with coverage for the shown single-variant image case.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, swift
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.