mirror of
https://github.com/librespeed/speedtest.git
synced 2026-06-29 05:12:28 +00:00
25 lines
924 B
Bash
Executable file
25 lines
924 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
# register QEMU handlers for emulation (one-time)
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
|
# create and use a buildx builder (if you don't already have one)
|
|
if ! docker buildx inspect mybuilder > /dev/null 2>&1; then
|
|
docker buildx create --name mybuilder --use
|
|
else
|
|
docker buildx use mybuilder
|
|
fi
|
|
docker buildx inspect --bootstrap
|
|
|
|
# change to repo root
|
|
cd ../..
|
|
|
|
# build the alpine image for arm64 and amd64
|
|
# Note: We cannot use --load with multiple platforms.
|
|
# We will build for arm64 specifically to test the emulation and load it.
|
|
echo "Building for linux/arm64..."
|
|
docker buildx build --platform linux/arm64 -f Dockerfile.alpine -t local-speedtest:alpine-arm64 --load .
|
|
|
|
# To build for both platforms, you typically need to push to a registry:
|
|
# docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.alpine -t local-speedtest:alpine --push .
|