docker buildx for multiarch support
create a builder
Newer Docker (Docker Desktop / Engine 29.0+ with the containerd image store) can build multi-platform images with the default docker builder. On older setups the default builder still rejects --platform, so create a docker-container builder like this — it is also required when you use a custom buildkitd.toml or push straight to a registry:
| |
if your self-build registry is not https, please touch a buildkitd.toml
| |
Note:
http = trueis for plain-HTTP registries;insecure = trueis for HTTPS with a self-signed certificate (usually pick one, not both).
and then use this config to create a builder
| |
build the multiarch image and push it to your registry
Make sure you are logged in to the target registry first (pushing images requires authentication):
| |
docker buildx inspect --bootstrap to get the supported platform information
On Linux, if you build for a platform you don’t have natively (e.g. arm64 on an amd64 host), register the emulator first — QEMU/binfmt is bundled with Docker Desktop, but manual setups need:
| |
| |