podman icon indicating copy to clipboard operation
podman copied to clipboard

Compat API v1.49: GET /images/{name}/json platform

Open chala2001 opened this issue 1 week ago • 1 comments

Feature request description

Docker API v1.49 added a platform query parameter to image inspect. The endpoint is GET /images/{name}/json. The value is a JSON encoded OCI platform, for example {"os":"linux","architecture":"arm64"}. It lets the client pick one platform from a multi-platform image. Podman's compat image inspect does not read platform today and always looks up the image without platform options.

Suggest potential solution

In the compat image inspect handler, read platform only when the API version is 1.49 or newer, like Docker. If the JSON is wrong or OS or architecture is missing, return 400 like Docker. Pass OS, architecture and variant to the image lookup, Podman's image library already supports choosing a platform. If no image matches that platform, return 404 (not found) like Docker does. Add API tests in test/apiv2.

Have you considered any alternatives?

No

Additional context

This is split out of #30162 item 1, the image inspect platform part. Parent epic #30159. I'd like to work on it.

chala2001 avatar Nov 20 '26 11:11 chala2001

/assign

chala2001 avatar Nov 20 '26 11:11 chala2001