Created attachment 5243 [details] container-bundle: override arch in skopeo copy command to support multiarch containers Hello, when bundling a multiarch container (e.g. docker.io/library/hello-world) using container-bundle.bbclass on wrynose, on my x86_64 dev machine for my ARM target, the amd64 version is bundled instead of the arm64 version. I added the --override-arch option to the skopeo command to make the sure the version for the target is used. See attached patch. Does it seem correct to you ?
This path is exercised heavily here and on the autobuilder, but our multiarch coverage takes a different route: we build the arches natively via oci-multiarch (each in its own multiconfig), and where we do bundle, host and target arch line up. So neither flow crosses an external multiarch image against a different target arch, which is exactly where you happened to hit. It is true that the skopeo copy in container-bundle passes no architecture, so for a multiarch source it falls back to skopeo-native's host arch (amd64 on an x86_64 builder). On a native build that happens to match the target; cross-building from x86_64 to arm, it grabs the wrong image. Rather than have you carry the patch, I've committed a slightly more general version. Instead of a fixed --override-arch, it derives the target arch from TARGET_ARCH via oe.go.map_arch -- the same mapping image-oci already uses for OCI builds -- and adds --override-variant for 32-bit arm (arm/v7 vs arm/v6). So it covers arm64, armv7, 386 and the rest without anyone hardcoding an arch. --override-os linux is set explicitly alongside it. One thing worth knowing: this assumes the pinned CONTAINER_DIGESTS digest is the manifest-list (index) digest -- then --override-arch selects the right entry from the list. For hello-world that's the case. If a digest ever pins a single-arch manifest, the override can't reselect, and shouldn't need to. This is on master-next; I'll get it onto wrynose too since that's what you're on. After that the bundle should pick the target arch without your local patch.
Ok, thanks. What's the time frame for the backport to wrynose ?
I pulled the wrynose branch, everything is working as expected (including fixes for #16402).
The more general fix (deriving the target arch for the skopeo copy from TARGET_ARCH via oe.go.map_arch) is in master and was backported to wrynose; the reporter confirmed it works. Closing.