Docker
From Timon's Wiki
Multi-arch Build
Builder Setup
Install QEMOU to allow emulation of different arches. Using emulation is not the most efficient way to build an image. See Docker docs for more other ways.
docker run --privileged --rm tonistiigi/binfmt --install all
Creating the new builder:
docker buildx create --name <Name> --bootstrap --use
Replace <Name> with a different name. The Flag --use will automaticity select the builder as default. Running docker buildx ls should show your new builder with all kind of platforms available.
Building an Image
Edit your Dockerfile to select the arch depending on the build argument.
- FROM alpine:latest
+ ARG ARCH=
+ FROM ${ARCH}alpine:latest
Now you can build your image using
