From 4bad3e32188808559538f5e7fbc93f91c7c1215e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 27 Jul 2025 03:07:01 +0000 Subject: [PATCH] Pass the platform to buildx on the command line --- build-single.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-single.sh b/build-single.sh index 9ba790c..9c1aabb 100755 --- a/build-single.sh +++ b/build-single.sh @@ -1,12 +1,13 @@ TARGET_NAME="$1-$2" DOCKERFILE="Dockerfile.$1.$2" +EXTRA_ARGS="--pull" if [ "$1" == "aarch64" ] || [ "$1" == "rpi64" ] || [ "$1" == "l4t" ]; then - DOCKER_DEFAULT_PLATFORM="linux/arm64" + EXTRA_ARGS="$EXTRA_ARGS --platform linux/arm64" elif [ "$1" == "armhf" ] || [ "$1" == "rpi" ]; then - DOCKER_DEFAULT_PLATFORM="linux/arm/v7" + EXTRA_ARGS="$EXTRA_ARGS --platform linux/arm/v7" elif [ "$1" == "riscv64" ]; then - DOCKER_DEFAULT_PLATFORM="linux/riscv64" + EXTRA_ARGS="$EXTRA_ARGS --platform linux/riscv64" fi TAG_UNIQUE_ID=`(git ls-tree HEAD; git diff-index HEAD) | sha256sum | cut -c-16` @@ -25,7 +26,7 @@ if [ $PULL_EXIT_CODE -eq 0 ]; then echo Using pre-built Docker image - cgutman/moonlight-packaging:$TAG_NAME else echo Pre-built image not available - building cgutman/moonlight-packaging:$TAG_NAME - docker buildx build --pull -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME . + docker buildx build $EXTRA_ARGS -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME . echo Built Docker image - cgutman/moonlight-packaging:$TAG_NAME fi