Skip to content

Please update multi-platform to mention that the official buildkit will do non-native emulation via QEMU #22899

Open
@sitsofe

Description

@sitsofe

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

On https://docs.docker.com/build/building/multi-platform/#prerequisites there is the following:

If you're using Docker Engine standalone and you need to build multi-platform images using emulation, you also need to install QEMU, see Install QEMU manually.

However, it turns out that non-Docker desktop buildkit itself will quietly try and do QEMU emulation (but as the name implies only at build time)! From https://github.com/moby/buildkit/blob/master/docs/multi-platform.md :

When your build needs to run a binary for architecture that is not supported natively by your host, it gets executed using a QEMU user-mode emulator. You do not need to set up QEMU manually in most cases.

I only know this because I spent some time scratching my head as to how a foreign architecture's build was succeeding on a machine that didn't have separate QEMU emulation configured (and yet actually running the built foreign architecture image was failing with exec format error as expected). At the time a Google search for "docker inbuilt qemu build" didn't turn up anything useful so hopefully creating this issue helps.

Location

https://docs.docker.com/build/building/multi-platform/

Suggestion

Please add a note that if buildkit XYZ or later is used then architecture emulation will automatically be tried using a built-in QEMU .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions