0

I'm trying to run an amd64 UBI9 image on Apple silicon with Podman. Podman provides a Fedora CoreOS VM to run containers in. It allows for installing qemu binaries to run "foreign architecture" containers.

Problem is, the architecture of the UBI9 images is x86_64-v2 and the qemu-x86_64-static binary in the Fedora CoreOS VM does not support that (yet?).

That means that running said image results in an error:

➜ podman build -f Containerfile --platform linux/amd64 -t mycontainer:0.3 .
STEP 1/7: FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
STEP 2/7: RUN microdnf install -y python3 python3-pip
Fatal glibc error: CPU does not support x86-64-v2
Error: error building at STEP "RUN microdnf install -y python3 python3-pip": error while running runtime: exit status 127

From what I understand, setting an environment variable called QEMU_CPU to max in the VM might solve this, but I'm unsure how and where to set that variable for it to be picked up by the podman processes.

Anyone solved this already?

(I could have put this on the MacOS site, the Superuser site and stackoverflow.com, I guess, but I think it fits here best because of the specific knowledge required.)

wzzrd
  • 10,269
  • 2
  • 32
  • 47

1 Answers1

0

Your command, you specify 'amd64', it won't work... You run a ARM processor. And the VM is aware of that. You can't run a x86 image on a ARM.

Or you could run:

podman run -it --arch=arm64 registry.access.redhat.com/ubi9/ubi:9.0.0-1604 /bin/bash

I am not sure about this one TBH. I think it does ''emulation'' but really not sure. But I know the container will start....

P.S: Do not forget that not all containers are built for Apple Silicon (ARM) and this apply to packages as well

yield
  • 731
  • 1
  • 8
  • 24
  • It can definitely work: Podman and Docker provide a qemu-x86_64 binary that can translate system call and interpret te executable format of foreign architectures (not an expert, but that’s roughly what it does). Problem is that the shipped binary is not compatible with the x86_64-v2 format of RHEL9 – wzzrd Aug 25 '22 at 15:25