4.9. Building multi-architecture images
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
-
Create
Containerfilesfor each architecture you want to support. Build images for each architecture. For example:
$ podman build --platform linux/arm64,linux/amd64 --manifest <registry>/<image> .-
The
--platform linux/arm64,linux/amd64option specifies the target platforms for which the container image is being built. -
The
--manifest <registry>/<image>option creates a manifest list with the specified name, that is<registry>/<image>, and adds the newly-built images to them. A manifest list is a collection of image manifests, each one targeting a different architecture.
-
The
Push the manifest list to the registry:
$ podman manifest push <registry>/<image>This manifest list acts as a single entry point for pulling the multi-architecture container.
As a result, you can pull the appropriate container image for your platform, based on a single manifest list.
You can also remove items from the manifest list by using the
podman manifest remove <manifest_list> <digest_ID>command, where<digest_ID>is the SHA-256 checksum of the container image. For example:podman manifest remove <registry>/<image> sha256:cb8a924afdf….
Verification
Display the manifest list:
$ podman manifest inspect <registry>/<image>Refer to the
podman-build(1)andpodman-manifest(1)man page on your system for more information.