File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # register QEMU handlers for emulation (one-time)
5+ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
6+
7+ # create and use a buildx builder (if you don't already have one)
8+ if ! docker buildx inspect mybuilder > /dev/null 2>&1 ; then
9+ docker buildx create --name mybuilder --use
10+ else
11+ docker buildx use mybuilder
12+ fi
13+ docker buildx inspect --bootstrap
14+
15+ # change to repo root
16+ cd ../..
17+
18+ # build the alpine image for arm64 and amd64
19+ # Note: We cannot use --load with multiple platforms.
20+ # We will build for arm64 specifically to test the emulation and load it.
21+ echo " Building for linux/arm64..."
22+ docker buildx build --platform linux/arm64 -f Dockerfile.alpine -t local-speedtest:alpine-arm64 --load .
23+
24+ # To build for both platforms, you typically need to push to a registry:
25+ # docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.alpine -t local-speedtest:alpine --push .
You can’t perform that action at this time.
0 commit comments