From 79c05d92fd96718455ab3db58777074c0f75a055 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Thu, 21 Mar 2024 17:13:45 +0900 Subject: [PATCH 1/2] packaging: build: Make to be able to replace docker cli via environment variable Signed-off-by: Hiroshi Hatake --- packaging/build.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packaging/build.sh b/packaging/build.sh index da050ec1b07..97c71ab1f91 100755 --- a/packaging/build.sh +++ b/packaging/build.sh @@ -10,6 +10,7 @@ FLB_DISTRO=${FLB_DISTRO:-} FLB_OUT_DIR=${FLB_OUT_DIR:-} FLB_NIGHTLY_BUILD=${FLB_NIGHTLY_BUILD:-} FLB_JEMALLOC=${FLB_JEMALLOC:-On} +DOCKER=${FLB_DOCKER_CLI:-docker} # Use this to pass special arguments to docker build FLB_ARG=${FLB_ARG:-} @@ -76,11 +77,15 @@ echo "CMAKE_INSTALL_PREFIX => $CMAKE_INSTALL_PREFIX" echo "FLB_NIGHTLY_BUILD => $FLB_NIGHTLY_BUILD" echo "FLB_JEMALLOC => $FLB_JEMALLOC" -export DOCKER_BUILDKIT=1 +if [ ${DOCKER} = "docker" ]; then + export DOCKER_BUILDKIT=1 +else + export DOCKER_BUILDKIT=0 +fi # Build the main image - we do want word splitting # shellcheck disable=SC2086 -if ! docker build \ +if ! ${DOCKER} build \ --build-arg CMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ --build-arg FLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \ --build-arg FLB_JEMALLOC="$FLB_JEMALLOC" \ @@ -95,7 +100,7 @@ then fi # Compile and package -if ! docker run \ +if ! ${DOCKER} run \ -v "$volume":/output \ "$MAIN_IMAGE" then From 319e54cfd0503f0b3d5aa00ffb854c2f49424e05 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Thu, 21 Mar 2024 18:31:15 +0900 Subject: [PATCH 2/2] packaging: build: Suppress a shellcheck error Signed-off-by: Hiroshi Hatake --- packaging/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/build.sh b/packaging/build.sh index 97c71ab1f91..cec48e8ad8c 100755 --- a/packaging/build.sh +++ b/packaging/build.sh @@ -77,7 +77,7 @@ echo "CMAKE_INSTALL_PREFIX => $CMAKE_INSTALL_PREFIX" echo "FLB_NIGHTLY_BUILD => $FLB_NIGHTLY_BUILD" echo "FLB_JEMALLOC => $FLB_JEMALLOC" -if [ ${DOCKER} = "docker" ]; then +if [ "${DOCKER}" = "docker" ]; then export DOCKER_BUILDKIT=1 else export DOCKER_BUILDKIT=0