When you build a Docker image with docker buildx build
and specify ‘–platform=linux/arm/v6’, the build container runs as arm7l
rather than the expected arm6l
, which creates issues if the build process assumes the observed CPU architecture is the actual target.
When running a Docker image, one can set the environment variable QEMU_CPU to arm1176 as in:
docker run -it --rm --platform linux/arm/v6 -e QEMU_CPU=arm1176 debian:testing-slim /bin/arch
Resulting in arm6l
, but that doesn’t seem possible with docker build
. Setting the QEMU_CPU varible before running docker buildx build
will have no effect on the build container, and it’ll still identify the CPU architecture as arm7l
.
Is there a way to pass the QEMU_CPU variable down to the build container?