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.)
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:
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