From 7e575f54c39c73fc691ab388558c8ebbd1c117b3 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Thu, 24 Feb 2022 17:34:47 +0100 Subject: [PATCH] build: down prioritise docker buildx --- scripts/buildx.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/buildx.sh b/scripts/buildx.sh index d72b4bd1f..1e475bcf4 100755 --- a/scripts/buildx.sh +++ b/scripts/buildx.sh @@ -16,7 +16,7 @@ set -euo pipefail help() { echo echo "-h|--help: To display this usage information" - echo "--profile : EMQX profile to build, e.g. emqx, emqx-edge" + echo "--profile : EMQX profile to build (emqx|emqx-edge|emqx-enterprise)" echo "--pkgtype tgz|pkg: Specify which package to build, tgz for .tar.gz," echo " pkg for .rpm or .deb" echo "--with-elixir: Specify if the release should be built with Elixir, " @@ -24,7 +24,7 @@ help() { echo "--arch amd64|arm64: Target arch to build the EMQX package for" echo "--src_dir : EMQX source ode in this dir, default to PWD" echo "--builder : Builder image to pull" - echo " E.g. ghcr.io/emqx/emqx-builder/5.0-7:1.13.3=24.2.1-1-debian10" + echo " E.g. ghcr.io/emqx/emqx-builder/5.0-7:1.13.3-24.2.1-1-debian10" echo "--otp : OTP version being used in the builder" echo "--elixir : Elixir version being used in the builder" echo "--system : OS used in the builder image" @@ -128,15 +128,7 @@ PKG_NAME="${PROFILE}-$(./scripts/pkg-full-vsn.sh "$PROFILE")" CMD_RUN="export EMQX_NAME=\"$PROFILE\"; make ${MAKE_TARGET} && ./scripts/pkg-tests.sh $PKG_NAME $PKGTYPE" -if docker info; then - docker run --rm --privileged tonistiigi/binfmt:latest --install "${ARCH}" - docker run -i --rm \ - -v "$(pwd)":/emqx \ - --workdir /emqx \ - --platform="linux/$ARCH" \ - "$BUILDER" \ - bash -euc "$CMD_RUN" -elif [[ $(uname -m) = "x86_64" && "$ARCH" = "amd64" ]]; then +if [[ $(uname -m) = "x86_64" && "$ARCH" = "amd64" ]]; then eval "$CMD_RUN" elif [[ $(uname -m) = "aarch64" && "$ARCH" = "arm64" ]]; then eval "$CMD_RUN" @@ -144,6 +136,14 @@ elif [[ $(uname -m) = "arm64" && "$ARCH" = "arm64" ]]; then eval "$CMD_RUN" elif [[ $(uname -m) = "armv7l" && "$ARCH" = "arm64" ]]; then eval "$CMD_RUN" +elif docker info; then + docker run --rm --privileged tonistiigi/binfmt:latest --install "${ARCH}" + docker run -i --rm \ + -v "$(pwd)":/emqx \ + --workdir /emqx \ + --platform="linux/$ARCH" \ + "$BUILDER" \ + bash -euc "$CMD_RUN" else echo "Error: Docker not available on unsupported platform" exit 1;