Running ARM arch Docker on x86_64 with qemu

Is there any tutorials, documentation for how to run ARM arch docker images on OpenSUSE?

Documentation I have found seems to be only for Ubuntu, and I am not getting it to work on on OpenSUSE.
OpenSUSE does not have the same packages it suggest installing.

https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/
https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/
https://codepyre.com/2019/12/arming-yourself/

I have installed the following packages.


qemu-
qemu-arm
qemu-block-curl
qemu-block-rbd
qemu-block-ssh
qemu-ipxe
qemu-ksm
qemu-kvm
qemu-linux-user
qemu-microvm
qemu-ovmf-x86_64
qemu-seabios
qemu-sgabios
qemu-tools
qemu-ui-curses
qemu-ui-gtk
qemu-ui-sdl
qemu-ui-spice-app
qemu-vgabios
qemu-x86

Still running an arm arch docker fails.

run -it --rm balenalib/raspberry-pi-alpine-node
WARNING: The requested image's platform (linux/arm/v6) does not match the detected host platform (linux/amd64) and no specific platform was requested
standard_init_linux.go:219: exec user process caused: exec format error

Hi
Assuming the image is built with multi arch support?

I see this: https://docs.docker.com/desktop/multi-arch/

That is Docker Desktop. I reckon it also works on Docker Linux?

So only images built with multi-arch support is possible to use?
For instance OpenSUSE Leap images, those are available for multiple archs.
https://hub.docker.com/r/opensuse/leap

A plain ARM arch image cannot be used with qemu emulator?
https://hub.docker.com/r/arm64v8/alpine

Why is that?

That link you posted says very little how to run an ARM arch image on x86 Linux, just that it is possble. It is mostly about building multi-arch images.

A colleague has gotten this to work on Fedora.
It configures something with qemu that OpenSUSE does not.

I tried to run the following configuration script:
https://github.com/qemu/qemu/blob/master/scripts/qemu-binfmt-conf.sh

Running an ARM arch docker image after this configuration gives out a different error now


docker run -it --rm -v /usr/bin/qemu-arm-binfmt:/usr/bin/qemu-arm-binfmt arm64v8/alpine uname -a  
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was req
uested
standard_init_linux.go:219: exec user process caused: no such file or directory

I tried running the opensuse/leap:15.3 ARM image as suggested in that Docker Desktop Multu-Arch link.


docker run -it opensuse/leap:15.3@sha256:8574b945ac07b7be3d35e0dbef01c9b518f701cca807a0e4f98b16e3bea6c62c uname -a
Unable to find image 'opensuse/leap:15.3@sha256:8574b945ac07b7be3d35e0dbef01c9b518f701cca807a0e4f98b16e3bea6c62c' locally
opensuse/leap@sha256:8574b945ac07b7be3d35e0dbef01c9b518f701cca807a0e4f98b16e3bea6c62c: Pulling from opensuse/leap
f6daa3991579: Pull complete  
Digest: sha256:8574b945ac07b7be3d35e0dbef01c9b518f701cca807a0e4f98b16e3bea6c62c
Status: Downloaded newer image for opensuse/leap@sha256:8574b945ac07b7be3d35e0dbef01c9b518f701cca807a0e4f98b16e3bea6c62c
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
standard_init_linux.go:219: exec user process caused: exec format error

Hi
Have a read here: https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/getting-started-with-docker-for-arm-on-linux

AFAIK you need to use buildx in the recipe? My use of docker is limited HA clusters (for Rancher) in virtual machines (via vagrant) and all x86_64 :frowning: If need aarch64 it’s on RPi3’s…

I followed the section about
Register Arm executables to run on x64 machines

docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3

After this I was able to run my ARM arch docker images

docker run --rm opensuse/leap:15.3@sha256:8574b945ac07b7be3d35e0dbef01c9b518f701cca807a0e4f98b16e3bea6c62c uname -a

I wish there was an easier way to run a different arch image, without specifying the SHA hash.

docker run --rm --arch=aarch64 opensuse/leap:15.3 uname -a

I was also able to run ARM aarch64 docker images that was not built with multi-arch support. Or I don’t think they are. These images are only offered in ARM aarch64.

docker run --rm arm64v8/alpine uname -a