File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,20 @@ current)
3131 if [ " $BASE_ARCH " = " arm64" ]; then
3232 BASE_ARCH=aarch64
3333 fi
34+ PLATFORM_ARG=" "
3435 ;;
3536aarch64)
3637 BASE_ARCH=aarch64
38+ PLATFORM_ARG=" --platform=linux/arm64"
3739 # shellcheck disable=SC2039
3840 echo -e " \e[033m* Using different arch needs to setup qemu-static for docker !\e[0m"
3941 $DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
42+ if ! $DOCKER_EXECUTABLE buildx inspect cwcc-spc-gnu-$SPC_USE_ARCH -builder > /dev/null 2>&1 ; then
43+ $DOCKER_EXECUTABLE buildx create --use --name cwcc-spc-gnu-$SPC_USE_ARCH -builder
44+ $DOCKER_EXECUTABLE buildx inspect --bootstrap
45+ else
46+ $DOCKER_EXECUTABLE buildx use cwcc-spc-gnu-$SPC_USE_ARCH -builder
47+ fi
4048 ;;
4149* )
4250 echo " Current arch is not supported to run in docker: $SPC_USE_ARCH "
4755# Detect docker env is setup
4856if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-gnu-$SPC_USE_ARCH ; then
4957 echo " Docker container does not exist. Building docker image ..."
50- $DOCKER_EXECUTABLE build -t cwcc-spc-gnu-$SPC_USE_ARCH -f- . << EOF
58+ $DOCKER_EXECUTABLE buildx build $PLATFORM_ARG -t cwcc-spc-gnu-$SPC_USE_ARCH -f- . << EOF
5159FROM centos:7
5260RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
5361 sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
You can’t perform that action at this time.
0 commit comments