liveBook · Manning

Build farm

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

A build farm is a collection of build machines with different execution environments or processor architectures for producing software artifacts.

A build farm is a collection of build machines with different operating systems or CPU architectures. Each machine builds an image variant for its platform, allowing a single multi-platform image to be produced accurately and quickly. section 12.3

Emulation can build occasional Arm variants, but it is slow and may not reproduce real CPU behavior perfectly. A build farm instead sends work to native Docker Engines, then publishes the variants and their manifest. section 12.3

A practical Buildx workflow is:

  • Create Docker contexts that identify the Docker Engines used by the builders. section 12.4
  • Create a Buildx builder with one node for each target platform, such as linux/amd64 and linux/arm64. section 12.4
  • Run one build command for all platforms and push the resulting variants and multi-platform manifest. section 12.4

A two-platform Buildx farm

Duplicate the current Docker context, create a builder with amd64 and arm64 nodes, and build the application with `docker buildx build --builder ch12-builder --platform linux/arm64,linux/amd64 -t <docker-id>/ch12-hello-x:2e --push ./hello`. The nodes build their assigned platforms, and Buildx pushes the multi-platform manifest. section 12.4

# create the builder – this adds a node with the current context:
docker buildx create --name ch12-builder --platform linux/amd64
# append a second node using the duplicate context:
docker buildx create --append --name ch12-builder `
 --platform linux/arm64 ch12-context
# list your builders:
docker buildx ls

Use the builder commands to assign platforms to nodes and inspect the resulting build farm. section 12.4

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

How deep it goes
Explains platform assignment, Docker contexts, builder nodes, and publishing, but defers detailed network security and varied Dockerfiles.
Examples
Demonstrates Docker context duplication, a two-node Buildx builder, and a pushed linux/amd64 and linux/arm64 image.
What it assumes
Assumes Docker command-line access and Docker Engines, while introducing contexts, builders, nodes, and platform assignment.
What you can do after
Build and publish multi-platform Linux images with Docker Buildx using builders assigned to different CPU architectures.
How it connects
Connects multi-platform images with Docker Engine, Docker contexts, Buildx, CI/CD pipelines, and manifest lists.

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.