<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16405</bug_id>
          
          <creation_ts>2026-08-20 16:13:35 +0000</creation_ts>
          <short_desc>meta-virtualization: skopeo copy command in container-bundle use host arch</short_desc>
          <delta_ts>2026-10-27 22:16:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Other YP Layers</product>
          <component>layers</component>
          <version>6.0</version>
          <rep_platform>ARM</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.0.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Frétigné">martin.fretigne</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106605</commentid>
    <comment_count>0</comment_count>
      <attachid>5243</attachid>
    <who name="Martin Frétigné">martin.fretigne</who>
    <bug_when>2026-08-20 16:13:35 +0000</bug_when>
    <thetext>Created attachment 5243
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 ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106606</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2026-08-20 18:20:33 +0000</bug_when>
    <thetext>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&apos;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&apos;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&apos;s the
case. If a digest ever pins a single-arch manifest, the override can&apos;t
reselect, and shouldn&apos;t need to.

This is on master-next; I&apos;ll get it onto wrynose too since that&apos;s what
you&apos;re on.  After that the bundle should pick the target arch without
your local patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106608</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Frétigné">martin.fretigne</who>
    <bug_when>2026-08-20 23:28:59 +0000</bug_when>
    <thetext>Ok, thanks. What&apos;s the time frame for the backport to wrynose ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106622</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Frétigné">martin.fretigne</who>
    <bug_when>2026-08-24 10:54:56 +0000</bug_when>
    <thetext>I pulled the wrynose branch, everything is working as expected (including fixes for #16402).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107208</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2026-10-27 22:16:35 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5243</attachid>
            <date>2026-08-20 16:13:35 +0000</date>
            <delta_ts>2026-08-20 16:13:35 +0000</delta_ts>
            <desc>container-bundle: override arch in skopeo copy command to support multiarch containers</desc>
            <filename>0001-container-bundle-override-arch-in-skopeo-copy-comman.patch</filename>
            <type>text/plain</type>
            <size>2066</size>
            <attacher name="Martin Frétigné">martin.fretigne</attacher>
            
              <data encoding="base64">RnJvbSBiNzdmYzY2YTMzNjU2ZWViMTNiMTI1NTFhZTBmZTM0N2FkYTdmMmI4IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/TWFydGluPTIwRnI9QzM9QTl0aWduPUMzPUE5
Pz0gPG1hcnRpbi5mcmV0aWduZUBnbWFpbC5jb20+CkRhdGU6IFRodSwgMjAgQXVnIDIwMjYgMTc6
MzU6MjcgKzAyMDAKU3ViamVjdDogW1BBVENIIDEvMV0gY29udGFpbmVyLWJ1bmRsZTogb3ZlcnJp
ZGUgYXJjaCBpbiBza29wZW8gY29weSBjb21tYW5kIHRvCiBzdXBwb3J0IG11bHRpYXJjaCBjb250
YWluZXJzCgotLS0KIGNsYXNzZXMvY29udGFpbmVyLWJ1bmRsZS5iYmNsYXNzIHwgIDMgKystCiBj
bGFzc2VzL2NvbnRhaW5lci1jb21tb24uYmJjbGFzcyB8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ICdhbWQ2NCcsCisg
ICAgICAgICdpNTg2JzogJ2FtZDY0JywKKyAgICB9CisgICAgcmV0dXJuIGJsb2JfbWFwLmdldChh
cmNoLCAnYXJtNjQnKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>