Move to buildah qemu based multi-arch container builds
By now it is possible to build containers for differing architectures using buildah.
On fedora one has to install qemu-user-static
to enable the multi-arch capabilities in buildah (and therefore in podman build
command). After installing this package the --arch
or --platform
flags of the build command do the correct, emulated thing.
I have yet to test how extensively this emulation can be used and how reliable it is.
Implementation notes
There is now the possibility to just make the podman build
command a loop over architectures and use the podman build --manifest
flag to associate the build (and untagged) images with a manifest. This way we could build a manifest with multiple images which in turn do not appear tagged on the registry but are only published as part of the manifest which might be more intuitive.
Now that I think about it, one could've just build the images without tags and moved the unfinished partial manifest through caches or artifacts.
Performance wise seem qemu based image builds to be considerably slower than native builds. Compared to that we have slow startup times of the arm64 build runners. At the end we might not win a lot here.
On the other hand does this probably reduce complexity.
TODOs:
-
add basic ability and instructions how to use qemu based cross-compile -
check if we can get rid of --privileged
requirement -
check if we can get rid of "qemu installed in host image" requirement -
add an option to build all architectures on one runner job