MultiArch Builds
docker: Error response from daemon: image with reference multiarch/qemu-user-static was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64.
This error message suggests that you are trying to run a Docker image on a platform that is different from the one for which the image was built. The image you are trying to run is built for the linux/arm64 platform, but the platform of your host system is linux/amd64.
To resolve this issue, you can use a tool called qemu-user-static to run the linux/arm64 binary on your linux/amd64 system. The qemu-user-static tool allows you to run binaries for foreign architectures on your host system by providing a lightweight emulation layer.
To use qemu-user-static, you need to follow these steps:
- Install the
qemu-user-staticpackage on your host system. On Ubuntu or Debian, you can do this with the following command:
sudo apt-get install qemu-user-static- Download the
multiarch/qemu-user-staticDocker image for thelinux/arm64platform:
docker pull multiarch/qemu-user-static:register- Register the
qemu-user-staticbinary as the default interpreter for thelinux/arm64platform:
docker run --rm --privileged multiarch/qemu-user-static:register --reset- Try running your Docker image again:
docker run my_imageThis time, Docker should use the qemu-user-static binary to run the linux/arm64 binary in your Docker image on your linux/amd64 host system.

I am using macos
I apologize for the confusion. binfmt-support is a Linux package that provides support for registering binary formats with the kernel, and it's not available on macOS.
On macOS, you can use a tool called docker-binfmt to register support for foreign architectures. Here are the steps you can follow:
- Install
docker-binfmtby running the following command in a terminal:
brew install docker-binfmt- Enable
docker-binfmtby running the following command:
bsudo docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64This command will enable support for various foreign architectures, including linux/arm64.
- Try running your Docker image again:
docker run my_imageThis time, Docker should be able to run the linux/arm64 binary in your Docker image on your macOS host system.
I hope this helps!