Pass the platform to buildx on the command line

This commit is contained in:
Cameron Gutman
2025-07-27 03:07:01 +00:00
parent 1a1507dd51
commit 4bad3e3218

View File

@@ -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