Buildx Remote Builder
# copy ssh key to target remote builder machine
ssh-copy-id username@target_host
# create a builder to build arm images locally on apple silicon
docker buildx create \
--name local_remote_builder \
--node local_remote_builder \
--platform linux/arm64*, linux/riscv64*, linux/ppc64le*, linux/s390x*, linux/mips64le*, linux/mips64*, linux/arm/v7*, linux/arm/v6*
# create a remote node and attach it to the local_remote_builder from above
docker buildx create \
--name local_remote_builder \
--append \
--node remote_x86 \
--platform linux/amd64,linux/386 \
ssh://username@target_host
docker buildx use local_remote_builder
docker buildx inspect --bootstrap
# build for target platform
docker buildx build --platform linux/amd64 --output type=docker . -t target
# or
docker buildx build --platform=linux/amd64 --push -t name/target:tag .
comments powered by Disqus