Konubinix' opinionated web of thoughts

Buildx

Fleeting

Docker Buildx | Docker Documentation

[2021-01-22 Fri 20:19]

Docker Buildx is a CLI plugin that extends the docker command with the full support of the features provided by Moby BuildKit builder toolkit.

[2021-01-22 Fri 20:20]

The docker buildx build command supports features available for docker build, including the new features in Docker 19.03

[2021-01-22 Fri 20:25]

By default, Buildx uses the “docker” driver if it is supported, providing a user experience very similar to the native docker build.

[2021-01-22 Fri 20:25]

Buildx allows you to create new instances of isolated builders.

[2021-01-22 Fri 20:25]

BuildKit is designed to work well for building for multiple platforms and not only for the architecture and operating system that the user invoking the build happens to run.

[2021-01-22 Fri 20:26]

When the current builder instance is backed by the “docker-container” driver, you can specify multiple platforms together. In this case, it builds a manifest list which contains images for all of the specified architectures.

[2021-01-22 Fri 20:26]

You can build multi-platform images using three different strategies that are supported by Buildx and Dockerfiles:

Using the QEMU emulation support in the kernel Building on multiple native nodes using the same builder instance Using a stage in Dockerfile to cross-compile to different architectures

[2021-01-22 Fri 20:26]

When BuildKit needs to run a binary for a different architecture, it automatically loads it through a binary registered in the binfmt_misc handler.

[2021-01-22 Fri 20:27]

multiple native nodes provide better support for more complicated cases that are not handled by QEMU and generally have better performance