Docker has the ability to emulate amd64 on arm64 through qemu which is built into Docker Desktop for Mac.
Programs compiled for amd64/x86_64 should still work through this emulation if the Dockerfile is built for amd64
Dockerfile:
FROM --platform=linux/amd64 your_amd64_image
...
or env variable DOCKER_DEFAULT_PLATFORM=linux/amd64
The problem is that there seems to be a bug in qemu.
Here is a similar problem: https://gitlab.com/qemu-project/qemu/-/issues/340