liveBook · Manning

Multi-platform build

As explained in Learn Docker in a Month of Lunches, Second Edition

A cross-platform build is a build process that produces software artifacts targeted at more than one operating-system or processor platform.

A multi-platform build produces software artifacts for more than one operating-system or processor platform. Docker can build Linux images for Arm and Intel targets even when the builder uses only one architecture, provided the application tools and base images support those targets. section 12.1

Separate platform-tagged images are not yet a multi-platform image: users must choose the correct tag. A multi-platform image publishes several variants under one name, allowing Docker to select the variant matching the host OS and CPU. section 12.1 section 12.0

A practical workflow uses:

  • Emulation through Docker Desktop's QEMU support, or separately installed QEMU with Docker Engine on Linux. section 12.1
  • A multi-stage Dockerfile whose compiler and base images provide variants for the target platforms. section 12.1
  • CI/CD automation that compiles, tests, and publishes images, including builds on Windows and Linux agents with GitHub Actions. section 16.0

Build and inspect two Linux variants

Build the same application for linux/arm64 and linux/amd64 with Docker's platform flag, then inspect each image's OS and architecture. Docker can run the matching artifact on a genuine Arm or Intel machine. section 12.1

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains emulated builds, platform-tagged images, manifest matching, and CI automation, but does not detail registry publishing commands.
Examples
Uses Arm and Intel image builds, architecture inspection, and a failed Windows image pull without a matching variant.
What it assumes
Assumes basic Docker image building and introduces platform flags, emulation, image variants, and host-architecture matching.
What you can do after
Apply it via Docker commands to build and verify artifacts for Arm and Intel targets.
How it connects
Connects multi-stage builds, multi-platform images, manifest lists, emulation, Docker Compose, and CI/CD.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.