Skip to content

Add direct support to --manifest for building multi-architecture container images. #592

@MisterOwlPT

Description

@MisterOwlPT

Hi,

I am using podman‑py to automate the creation of multi‑architecture container images with podman.

My existing CLI workflow looks like this:

podman manifest create example:v1.2.3
podman build --manifest example:v1.2.3 --platform linux/amd64,linux/arm .

When translating these commands into calls to podman-py, I've noticed that the --manifest argument is not supported by the client.images.build function.

I am aware that podman-py already supports creating manifests and adding images to them.
However, I am left wondering if supporting the --manifest would not give developers an experience closer to the existing podman CLI and thus simplify the creation of scripts, as the creation of manifests and addition of images could all be done in a single call.

My proposal, for the same example CLI workflow above, is to allow something like this:

# ...
with PodmanClient(base_url=uri) as client:
  image, _ = client.images.build(
    path=".",
    dockerfile="Containerfile",
    manifest="example:v1.2.3",  # <-- here's the missing field - the manifest is created if it does not exist
    platform=["linux/amd64", "linux/arm64"],
  )

Here, the new optional manifest kwarg would accept the name of the manifest and automatically add the newly built image(s) to it.

What are your opinions on this feature?

Thanks a lot for your attention and for the project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions