Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading