@@ -18,7 +18,7 @@ error() {
1818 log_message 1 " [error] $* "
1919}
2020
21- if [[ " $ARCH " == " " ]]; then
21+ if [[ " ${ ARCH:- } " == " " ]]; then
2222 error " Usage: env ARCH=... bash $0 "
2323 exit 2
2424fi
@@ -29,16 +29,16 @@ this_dir="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
2929
3030case " $ARCH " in
3131 x86_64)
32- docker_arch= amd64
32+ docker_platform=linux/ amd64
3333 ;;
3434 i386)
35- docker_arch=i386
35+ docker_platform=linux/386
3636 ;;
3737 armhf)
38- docker_arch=arm32v7
38+ docker_platform=linux/arm/v7
3939 ;;
4040 aarch64)
41- docker_arch=arm64v8
41+ docker_platform=linux/arm64/v8
4242 ;;
4343 * )
4444 echo " Unsupported \$ ARCH: $ARCH "
4949# first, we need to build the image
5050# we always attempt to build it, it will only be rebuilt if Docker detects changes
5151# optionally, we'll pull the base image beforehand
52- info " Building Docker image for $ARCH (Docker arch : $docker_arch )"
52+ info " Building Docker image for $ARCH (Docker platform : $docker_platform )"
5353
5454build_args=()
5555if [[ " ${UPDATE:- } " == " " ]]; then
5858 build_args+=(" --pull" )
5959fi
6060
61- docker_image=linuxdeploy-plugin-qt-build: " $ARCH "
61+ docker_image=linuxdeploy-plugin-qt-build
6262
6363docker build \
64+ --platform " $docker_platform " \
6465 --build-arg ARCH=" $ARCH " \
65- --build-arg docker_arch=" $docker_arch " \
6666 " ${build_args[@]} " \
6767 -t " $docker_image " \
6868 " $this_dir " /docker
@@ -104,11 +104,12 @@ run_in_docker() {
104104 # b) allow the build scripts to "mv" the binaries into the /out directory
105105 docker run \
106106 --rm \
107+ --platform " $docker_platform " \
107108 -i \
108109 --init \
110+ -e ARCH \
109111 -e GITHUB_RUN_NUMBER \
110112 -e USE_STATIC_RUNTIME \
111- -e ARCH \
112113 -e CI \
113114 --user " $uid " \
114115 " ${docker_args[@]} " \
@@ -119,7 +120,7 @@ run_in_docker() {
119120}
120121
121122filename_suffix=
122- if [[ " $USE_STATIC_RUNTIME " != " " ]]; then
123+ if [[ " ${ USE_STATIC_RUNTIME:- } " != " " ]]; then
123124 filename_suffix=" -static"
124125fi
125126
0 commit comments