Docker multi-platform build using buildx
January 18, 2025 ยท View on GitHub
Build for different platforms
Tip: To figure which platforms to build for, head over to dockerhub and find what architectures your base image supports. For example, the alpine image supports
linux/amd64,linux/arm64etc.
docker buildx build --load\
--platform linux/amd64,linux/arm64,linux/386,linux/s390x,linux/arm/v7,linux/arm/v6,linux/ppc64le \
-t image:tag \
-f Dockerfile .
- Builds generated using buildx will not be available in the local docker registry. To push the image to the registry, use the
--pushflag. - To load the image into the local docker registry, use the
--loadflag.- After load you can choose to export it to a tar file using
docker save <image:tag> > test.tarand test it on another machine usingdocker load < test.tar.
- After load you can choose to export it to a tar file using