What I need:
A test container on a x86_64 machine for a raspberry pi zero, which works with qemu emulation for armv6l.
What I've got so far:
A Dockerfile with a test code
FROM python:3.7.9
COPY hello.py ./
CMD [ "python3", "./hello.py" ]
The image is built with this command:
docker buildx build --platform linux/arm/v6 -t test/hello --push .
After it has been uploaded and built for linux/arm/v6 I try to run it with this command:
docker run --platform=linux/arm/v6 --rm -t test/hello uname -mpi
Output: armv7l unknown unknown
I have set up qemu and binfmt like they say on their github page: https://github.com/docker/buildx#building-multi-platform-images
I do not understand why the output is armv7l, because I did everything to make an armv6l image. I do not know if I need to make adjustments to docker or qemu itself. I am quite new to the buildx system of docker and how to emulate the container under qemu so if anyone could help me out with this problem I would be very grateful.
EDIT:
Thanks to Peter the container is know forced to use armv6l.
docker run -e QEMU_CPU=arm1176 --platform=linux/arm/v6 --rm -t test/hello uname -mpi
Output: armv6l unknown unknown