Force architecture when building multiarch Docker images

  buildx, docker, docker-buildkit, multiarch, qemu

It seems that Docker (probably qemu) falls back to native execution in some cases even when the arch is not identical. For instance, it seems like qemu does not emulate x86 when running on x64. This causes me problems when building Docker multiarch images as uname returns x86_64 when platform is set to linux/386, for instance. The same is probably happening when platform is set to armv7 and I’m running on arm64.

Assuming this is correct: is it possible to force Docker (or qemu) to emulate the exact arch instead? I’d need uname to return the exact arch, or some build procedures may fail. Would it be possible to disable this behavior (better if temporarily)?

Source: Docker Questions