Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build x86_64 images using Rosetta #24797

Open
jeffmaury opened this issue Dec 8, 2024 · 2 comments
Open

Can't build x86_64 images using Rosetta #24797

jeffmaury opened this issue Dec 8, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. machine macos MacOS (OSX) related remote Problem is in podman-remote

Comments

@jeffmaury
Copy link

Issue Description

While preparing a demo, I'm trying to build https://github.com/redhat-developer/podman-desktop-demo/blob/main/primary-podify-demo/front/Dockerfile or https://github.com/redhat-developer/podman-desktop-demo/blob/main/primary-podify-demo/backend/Dockerfile with multi arch and got an error while building the amd64 image

Steps to reproduce the issue

Steps to reproduce the issue

  1. Clone https://github.com/redhat-developer/podman-desktop-demo
  2. Go into primary-podify-demo/front (or primary-podify-demo/backend)
  3. run podman build . --arch arm64,amd64

Describe the results you received

Error: [linux/amd64]: building at STEP "RUN yum install --installroot /mnt/rootfs coreutils-single curl shadow-utils --releasever 8 --nodocs -y && yum --installroot /mnt/rootfs clean all && rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*": while running runtime: exit status 1

Describe the results you expected

Build success

podman info output

host:
  arch: arm64
  buildahVersion: 1.37.5
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-2.fc40.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: '
  cpuUtilization:
    idlePercent: 99.06
    systemPercent: 0.38
    userPercent: 0.56
  cpus: 6
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "40"
  eventLogger: journald
  freeLocks: 2038
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.11.3-200.fc40.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 668618752
  memTotal: 3792834560
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.12.2-2.fc40.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.12.2
    package: netavark-1.12.2-1.fc40.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.12.2
  ociRuntime:
    name: crun
    package: crun-1.17-1.fc40.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.17
      commit: 000fa0d4eeed8938301f3bcf8206405315bc1017
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240906.g6b38f07-1.fc40.aarch64
    version: |
      pasta 0^20240906.g6b38f07-1.fc40.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-2.fc40.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.5
  swapFree: 0
  swapTotal: 0
  uptime: 7h 42m 22.00s (Approximately 0.29 days)
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 99252940800
  graphRootUsed: 13176152064
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 85
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.2.5
  Built: 1729209600
  BuiltTime: Fri Oct 18 02:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.7
  Os: linux
  OsArch: linux/arm64
  Version: 5.2.5

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

Apple M2 Pro

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@jeffmaury jeffmaury added the kind/bug Categorizes issue or PR as related to a bug. label Dec 8, 2024
@github-actions github-actions bot added the remote Problem is in podman-remote label Dec 8, 2024
@baude
Copy link
Member

baude commented Dec 9, 2024

i think --arch is a string in podman and buildah and therefore can only be one of them? I don't see anything about a list or concatenating them with commas.

@nalind agree?

@nalind
Copy link
Member

nalind commented Dec 9, 2024

Yes, --arch expects only one value. At some point we figured out that trying to support multiple values for that made it hard to figure out how flags that combine with it like --os and --variant would be expected to work. Using --platform to specify them as one or more groups is easier (for me, at least) to reason about, and --platform started accepting a comma-separated list of platform specs in buildah 1.23, which was in the podman 3.4 era. I think there might be some logic to try to make it work if we notice that --arch was given a list, but I'd recommend using --platform instead regardless.

But anyway, did yum output any error information when it failed? Is it crashing, or trying to do something that the emulator can't make work? Does an arm64 build succeed?

@Luap99 Luap99 added macos MacOS (OSX) related machine labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. machine macos MacOS (OSX) related remote Problem is in podman-remote
Projects
None yet
Development

No branches or pull requests

4 participants