buildx, and an image for two architectures

Apple Silicon arrived in November and a team suddenly has two architectures, which means an image built on a laptop may not run on the server.

$ docker buildx create --use --name multi
$ docker buildx build --platform linux/amd64,linux/arm64 
    -t registry.internal/app:1.4 --push .

# and the check
$ docker manifest inspect registry.internal/app:1.4 
  | jq -r '.manifests[].platform | "(.os)/(.architecture)"'
linux/amd64
linux/arm64

The arm64 half is built under emulation unless there is a native builder, and emulated builds of anything that compiles are several times slower — a PHP image with pecl extensions goes from two minutes to eleven. --push rather than --load is required for a multi-platform build, because the local image store cannot hold a manifest list. This is early in 2020 and becomes unavoidable within a year.