Skip to content

Commit

Permalink
packaging: build: Make to be able to replace docker cli via environme…
Browse files Browse the repository at this point in the history
…nt variable (#8612)

* packaging: build: Make to be able to replace docker cli via environment variable

Signed-off-by: Hiroshi Hatake <[email protected]>

* packaging: build: Suppress a shellcheck error

Signed-off-by: Hiroshi Hatake <[email protected]>

---------

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored Mar 21, 2024
1 parent 0b9a0e1 commit 2b05150
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packaging/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-}
Expand Down Expand Up @@ -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" \
Expand All @@ -95,7 +100,7 @@ then
fi

# Compile and package
if ! docker run \
if ! ${DOCKER} run \
-v "$volume":/output \
"$MAIN_IMAGE"
then
Expand Down

0 comments on commit 2b05150

Please sign in to comment.