mirror of
https://github.com/librespeed/speedtest.git
synced 2026-08-03 22:28:24 +00:00
add test script for arm docker build
This commit is contained in:
parent
cbe05e49ab
commit
17e4554e4d
1 changed files with 25 additions and 0 deletions
25
docker/test/test-arm-build.sh
Executable file
25
docker/test/test-arm-build.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/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 .
|
||||
Loading…
Add table
Add a link
Reference in a new issue