Skip to content
Open
Show file tree
Hide file tree
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
43 changes: 43 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ INSTALL_PACKAGE_NAME=${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit}
# Optional Apt/Yum additional parameters (e.g. releasever for AL2022/AL2023)
APT_PARAMETERS=${FLUENT_BIT_INSTALL_APT_PARAMETERS:-}
YUM_PARAMETERS=${FLUENT_BIT_INSTALL_YUM_PARAMETERS:-}
ZYPPER_PARAMETERS=${FLUENT_BIT_INSTALL_ZYPPER_PARAMETERS:-}

echo "================================"
echo " Fluent Bit Installation Script "
Expand Down Expand Up @@ -48,9 +49,11 @@ fi
# Set up version pinning
APT_VERSION=''
YUM_VERSION=''
ZYPPER_VERSION=''
if [ -n "${RELEASE_VERSION}" ]; then
APT_VERSION="=$RELEASE_VERSION"
YUM_VERSION="-$RELEASE_VERSION"
ZYPPER_VERSION="=$RELEASE_VERSION"
fi

# Now set up repos and install dependent on OS, version, etc.
Expand Down Expand Up @@ -143,6 +146,46 @@ EOF
cat /etc/apt/sources.list.d/fluent-bit.list
apt-get -y update
$INSTALL_CMD_PREFIX apt-get -y $APT_PARAMETERS install $INSTALL_PACKAGE_NAME$APT_VERSION
SCRIPT
;;
opensuse-leap)
$SUDO sh <<SCRIPT
rpm --import $RELEASE_KEY
cat << EOF > /etc/zypp/repos.d/fluent-bit.repo
[fluent-bit]
name = Fluent Bit
baseurl = $RELEASE_URL/opensuse/leap/VERSION_SUBSTR
gpgcheck=1
repo_gpgcheck=1
gpgkey=$RELEASE_KEY
enabled=1
type=rpm-md
autorefresh=1
EOF
sed -i 's|VERSION_SUBSTR|\$releasever|g' /etc/zypp/repos.d/fluent-bit.repo
cat /etc/zypp/repos.d/fluent-bit.repo
zypper --non-interactive --gpg-auto-import-keys refresh
$INSTALL_CMD_PREFIX zypper --non-interactive --gpg-auto-import-keys $ZYPPER_PARAMETERS install $INSTALL_PACKAGE_NAME$ZYPPER_VERSION
SCRIPT
;;
sles)
$SUDO sh <<SCRIPT
rpm --import $RELEASE_KEY
cat << EOF > /etc/zypp/repos.d/fluent-bit.repo
[fluent-bit]
name = Fluent Bit
baseurl = $RELEASE_URL/sles/VERSION_SUBSTR
gpgcheck=1
repo_gpgcheck=1
gpgkey=$RELEASE_KEY
enabled=1
type=rpm-md
autorefresh=1
EOF
sed -i 's|VERSION_SUBSTR|\$releasever|g' /etc/zypp/repos.d/fluent-bit.repo
cat /etc/zypp/repos.d/fluent-bit.repo
zypper --non-interactive --gpg-auto-import-keys refresh
$INSTALL_CMD_PREFIX zypper --non-interactive --gpg-auto-import-keys $ZYPPER_PARAMETERS install $INSTALL_PACKAGE_NAME$ZYPPER_VERSION
SCRIPT
;;
*)
Expand Down
4 changes: 4 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ The [`distros`](./distros/) directory contains OCI container definitions used to
| Debian | 11 | arm64v8 | debian/bullseye.arm64v8 |
| Debian | 10 | x86_64 | debian/buster |
| Debian | 10 | arm64v8 | debian/buster.arm64v8 |
| openSUSE | 15.6 | x86_64 | opensuse/15.6 |
| openSUSE | 15.6 | arm64v8 | opensuse/15.6.arm64v8 |
| SLES | 15.7 | x86_64 | sles/15.7 |
| SLES | 15.7 | arm64v8 | sles/15.7.arm64v8 |
| Ubuntu | 24.04 / Noble Numbat | x86_64 | ubuntu/24.04 |
| Ubuntu | 24.04 / Noble Numbat | arm64v8 | ubuntu/24.04.arm64v8 |
| Ubuntu | 22.04 / Jammy Jellyfish | x86_64 | ubuntu/22.04 |
Expand Down
16 changes: 16 additions & 0 deletions packaging/build-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@
"target": "almalinux/10.arm64v8",
"type": "rpm"
},
{
"target": "opensuse/15.6",
"type": "rpm"
},
{
"target": "opensuse/15.6.arm64v8",
"type": "rpm"
},
{
"target": "sles/15.7",
"type": "rpm"
},
{
"target": "sles/15.7.arm64v8",
"type": "rpm"
},
{
"target": "debian/bookworm",
"type": "deb"
Expand Down
125 changes: 125 additions & 0 deletions packaging/distros/opensuse/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Dockerfile to build latest opensuse leap
# Set this to the base image to use in each case, so if we want to build for opensuse/leap
# we would set BASE_BUILDER=opensuse-leap-base.
ARG BASE_BUILDER
# Lookup the name to use below but should follow the '<distro>-base' convention with slashes replaced.
# Use buildkit to skip unused base images: DOCKER_BUILDKIT=1

# Multiarch support
FROM multiarch/qemu-user-static:x86_64-aarch64 AS multiarch-aarch64

# opensuse/leap base image
# hadolint ignore=DL3006
FROM opensuse/leap AS opensuse-leap-base

# hadolint ignore=DL3037,DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake-full \
make \
bash \
systemd-devel \
postgresql postgresql-devel postgresql-server \
cyrus-sasl cyrus-sasl-devel \
libopenssl3 libopenssl-3-devel \
libyaml-devel && \
zypper clean -a && rm -rf /var/cache/zypp/*

# opensuse/leap base image
FROM opensuse/leap:15.6 AS opensuse-15.6-base

# hadolint ignore=DL3037,DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake-full \
make \
bash \
systemd-devel \
postgresql postgresql-devel postgresql-server \
cyrus-sasl cyrus-sasl-devel \
libopenssl3 libopenssl-3-devel \
libyaml-devel && \
zypper clean -a && rm -rf /var/cache/zypp/*

# opensuse/leap.arm64v8 base image
# hadolint ignore=DL3037,DL3029
FROM --platform=linux/arm64 opensuse/leap:15.6 AS opensuse-15.6.arm64v8-base

COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

# hadolint ignore=DL3033,DL3037
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake-full \
make \
bash \
systemd-devel \
postgresql postgresql-devel postgresql-server \
cyrus-sasl cyrus-sasl-devel \
libopenssl3 libopenssl-3-devel \
libyaml-devel && \
zypper clean -a && rm -rf /var/cache/zypp/*

# Need larger page size
ARG FLB_JEMALLOC_OPTIONS="--with-lg-page=16 --with-lg-quantum=3"
ENV FLB_JEMALLOC_OPTIONS=$FLB_JEMALLOC_OPTIONS

# Common build for all distributions now
# hadolint ignore=DL3006
FROM $BASE_BUILDER AS builder

ARG FLB_NIGHTLY_BUILD
ENV FLB_NIGHTLY_BUILD=$FLB_NIGHTLY_BUILD

# Docker context must be the base of the repo
WORKDIR /source/fluent-bit/
COPY . ./

WORKDIR /source/fluent-bit/build/
# CMake configuration variables
# Unused
ARG CFLAGS
ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/
ARG CMAKE_INSTALL_SYSCONFDIR=/etc/
ARG FLB_SIMD=On
ARG FLB_RELEASE=On
ARG FLB_TRACE=On
ARG FLB_SQLDB=On
ARG FLB_HTTP_SERVER=On
ARG FLB_OUT_KAFKA=On
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify if FLB_OUT_KAFKA is a valid CMake option and how it's used

echo "=== Checking for FLB_OUT_KAFKA in Dockerfiles ==="
rg -n 'FLB_OUT_KAFKA' --type-add 'docker:Dockerfile*' --type docker

echo "=== Checking CMakeLists for FLB_OUT_KAFKA ==="
rg -n 'FLB_OUT_KAFKA' -g 'CMakeLists.txt'

echo "=== Checking for FLB_OUT_KAFKA in all files ==="
rg -n 'FLB_OUT_KAFKA' --max-count 20

echo "=== Checking opensuse Dockerfile context around line 98 ==="
sed -n '90,125p' packaging/distros/opensuse/Dockerfile

Repository: fluent/fluent-bit

Length of output: 4622


Add missing FLB_OUT_KAFKA flag to CMake command.

FLB_OUT_KAFKA is defined as an ARG on line 98 but is not passed to CMake (lines 106-121). Other Dockerfiles (debian, ubuntu, raspbian, etc.) include -DFLB_OUT_KAFKA="$FLB_OUT_KAFKA" in their CMake invocations. Add this flag to the opensuse Dockerfile's cmake command to ensure consistent configuration.

🤖 Prompt for AI Agents
In packaging/distros/opensuse/Dockerfile around lines 98 and 106-121, the ARG
FLB_OUT_KAFKA is declared on line 98 but not forwarded to the CMake invocation;
update the CMake command(s) in the block at lines ~106-121 to include
-DFLB_OUT_KAFKA="$FLB_OUT_KAFKA" alongside the other -D flags so the Kafka
output option honors the build ARG the same way other distro Dockerfiles do.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we should use args if they are provided.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrick-stephens, thank you for confirming! The FLB_OUT_KAFKA flag should indeed be added to the CMake command in the opensuse Dockerfile to match the pattern used in other distro Dockerfiles. This will ensure the Kafka output plugin configuration is consistent across all packaging targets.

(/ ̄▽ ̄)/ ♪


🧠 Learnings used
Learnt from: ThomasDevoogdt
Repo: fluent/fluent-bit PR: 9277
File: .github/workflows/pr-compile-check.yaml:147-151
Timestamp: 2025-08-31T12:46:11.940Z
Learning: In fluent-bit, the correct CMake flag for using system librdkafka is `FLB_PREFER_SYSTEM_LIB_KAFKA=ON`.

Learnt from: ThomasDevoogdt
Repo: fluent/fluent-bit PR: 9277
File: .github/workflows/pr-compile-check.yaml:147-151
Timestamp: 2025-08-31T12:46:11.940Z
Learning: In fluent-bit CMakeLists.txt, the system library preference flags are defined as FLB_PREFER_SYSTEM_LIB_ZSTD and FLB_PREFER_SYSTEM_LIB_KAFKA with the FLB_ prefix.

Learnt from: cosmo0920
Repo: fluent/fluent-bit PR: 10832
File: src/wasm/CMakeLists.txt:112-131
Timestamp: 2025-09-04T07:28:37.083Z
Learning: In fluent-bit CMake files, the user cosmo0920 prefers treating Git as a command rather than a package, emphasizing that Git is not a pkg-config retrievable package but just a command.

ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_UNICODE_ENCODER=On
ARG FLB_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG SYSTEMD_UNITDIR=/usr/lib/systemd/system

RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \
-DFLB_SIMD="$FLB_SIMD" \
-DFLB_RELEASE="$FLB_RELEASE" \
-DFLB_TRACE="$FLB_TRACE" \
-DFLB_SQLDB="$FLB_SQLDB" \
-DFLB_HTTP_SERVER="$FLB_HTTP_SERVER" \
-DFLB_OUT_KAFKA="$FLB_OUT_KAFKA" \
-DFLB_KAFKA="$FLB_KAFKA" \
-DFLB_OUT_PGSQL="$FLB_OUT_PGSQL" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC_OPTIONS="$FLB_JEMALLOC_OPTIONS" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
-DFLB_UNICODE_ENCODER="${FLB_UNICODE_ENCODER}" \
-DSYSTEMD_UNITDIR="$SYSTEMD_UNITDIR" \
../

VOLUME [ "/output" ]
CMD [ "/bin/bash", "-c", "make --no-print-directory -j 4 && cpack -G RPM && cp *.rpm /output/" ]
90 changes: 90 additions & 0 deletions packaging/distros/sles/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
ARG BASE_BUILDER
# Lookup the name to use below but should follow the '<distro>-base' convention with slashes replaced.
# Use buildkit to skip unused base images: DOCKER_BUILDKIT=1

# Multiarch support
FROM multiarch/qemu-user-static:x86_64-aarch64 AS multiarch-aarch64

# sles base image
FROM registry.suse.com/bci/bci-base:15.7 AS sles-15.7-base

# hadolint ignore=DL3037,DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build curl ca-certificates gcc gcc-c++ cmake-full make bash \
wget unzip systemd-devel flex bison \
postgresql-server postgresql-devel cyrus-sasl-devel \
libopenssl-devel libyaml-devel && \
rm -rf /var/log/lastlog /var/log/tallylog /var/log/zypper.log /var/log/zypp/history /var/log/YaST2 && \
zypper clean -a

# sles base image is the same name for all architectures
# hadolint ignore=DL3029
FROM --platform=linux/arm64 registry.suse.com/bci/bci-base:15.7 AS sles-15.7.arm64v8-base

COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

# hadolint ignore=DL3037,DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build curl ca-certificates gcc gcc-c++ cmake-full make bash \
wget unzip systemd-devel flex bison \
postgresql-server postgresql-devel cyrus-sasl-devel \
libopenssl-devel libyaml-devel && \
rm -rf /var/log/lastlog /var/log/tallylog /var/log/zypper.log /var/log/zypp/history /var/log/YaST2 && \
zypper clean -a

# Need larger page size
ARG FLB_JEMALLOC_OPTIONS="--with-lg-page=16 --with-lg-quantum=3"
ENV FLB_JEMALLOC_OPTIONS=$FLB_JEMALLOC_OPTIONS

# Common build for all distributions now
# hadolint ignore=DL3006
FROM $BASE_BUILDER AS builder

ARG FLB_NIGHTLY_BUILD
ENV FLB_NIGHTLY_BUILD=$FLB_NIGHTLY_BUILD

# Docker context must be the base of the repo
WORKDIR /source/fluent-bit/
COPY . ./

WORKDIR /source/fluent-bit/build/
# CMake configuration variables
# Unused
ARG CFLAGS
ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/
ARG CMAKE_INSTALL_SYSCONFDIR=/etc/
ARG FLB_SIMD=On
ARG FLB_RELEASE=On
ARG FLB_TRACE=On
ARG FLB_SQLDB=On
ARG FLB_HTTP_SERVER=On
ARG FLB_OUT_KAFKA=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_UNICODE_ENCODER=On
ARG FLB_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG SYSTEMD_UNITDIR=/usr/lib/systemd/system

RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \
-DFLB_SIMD="$FLB_SIMD" \
-DFLB_RELEASE="$FLB_RELEASE" \
-DFLB_TRACE="$FLB_TRACE" \
-DFLB_SQLDB="$FLB_SQLDB" \
-DFLB_HTTP_SERVER="$FLB_HTTP_SERVER" \
-DFLB_OUT_KAFKA="$FLB_OUT_KAFKA" \
-DFLB_KAFKA="$FLB_KAFKA" \
-DFLB_OUT_PGSQL="$FLB_OUT_PGSQL" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC_OPTIONS="$FLB_JEMALLOC_OPTIONS" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
-DFLB_UNICODE_ENCODER="${FLB_UNICODE_ENCODER}" \
-DSYSTEMD_UNITDIR="$SYSTEMD_UNITDIR" \
../

VOLUME [ "/output" ]
CMD [ "/bin/bash", "-c", "make --no-print-directory -j 4 && cpack -G RPM && cp *.rpm /output/" ]
29 changes: 29 additions & 0 deletions packaging/test-release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ YUM_TARGETS=(
"amazonlinux:2023"
)

ZYPPER_TARGETS=(
"opensuse/leap:15.6"
"registry.suse.com/bci/bci-base:15.7"
)


for IMAGE in "${YUM_TARGETS[@]}"
do
echo "Testing $IMAGE"
Expand Down Expand Up @@ -113,3 +119,26 @@ do
check_version "$LOG_FILE"
rm -f "$LOG_FILE"
done

# New loop for ZYPPER_TARGETS
for IMAGE in "${ZYPPER_TARGETS[@]}"
do
echo "Testing $IMAGE"
LOG_FILE=$(mktemp)
# We do want word splitting for EXTRA_MOUNTS
# shellcheck disable=SC2086
$CONTAINER_RUNTIME run --rm -t \
-e FLUENT_BIT_PACKAGES_URL="${FLUENT_BIT_PACKAGES_URL:-https://packages.fluentbit.io}" \
-e FLUENT_BIT_PACKAGES_KEY="${FLUENT_BIT_PACKAGES_KEY:-https://packages.fluentbit.io/fluentbit.key}" \
-e FLUENT_BIT_RELEASE_VERSION="${FLUENT_BIT_RELEASE_VERSION:-}" \
-e FLUENT_BIT_INSTALL_COMMAND_PREFIX="${FLUENT_BIT_INSTALL_COMMAND_PREFIX:-}" \
-e FLUENT_BIT_INSTALL_PACKAGE_NAME="${FLUENT_BIT_INSTALL_PACKAGE_NAME:-fluent-bit}" \
-e FLUENT_BIT_INSTALL_ZYPPER_PARAMETERS="${FLUENT_BIT_INSTALL_ZYPPER_PARAMETERS:-}" \
$EXTRA_MOUNTS \
"$IMAGE" \
sh -c "zypper --non-interactive --gpg-auto-import-keys refresh && \
zypper --non-interactive --gpg-auto-import-keys install gpg curl; && \
$INSTALL_CMD /opt/fluent-bit/bin/fluent-bit --version" | tee "$LOG_FILE"
check_version "$LOG_FILE"
rm -f "$LOG_FILE"
done
11 changes: 10 additions & 1 deletion packaging/update-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ RPM_REPO_PATHS=( "amazonlinux/2"
"almalinux/8"
"almalinux/9"
"almalinux/10"
"opensuse/leap/15.6"
"sles/15.7"
)

if [[ "${AWS_SYNC:-false}" != "false" ]]; then
Expand All @@ -56,7 +58,14 @@ for RPM_REPO in "${RPM_REPO_PATHS[@]}"; do
aws s3 sync s3://"${AWS_S3_BUCKET_STAGING:?}/$RPM_REPO" "${BASE_PATH:?}/$RPM_REPO"
fi

/bin/bash -eux "$SCRIPT_DIR/update-yum-repo.sh"
case "$RPM_REPO" in
"opensuse/"* | "sles/"*)
/bin/bash -eux "$SCRIPT_DIR/update-zypper-repo.sh"
;;
*)
/bin/bash -eux "$SCRIPT_DIR/update-yum-repo.sh"
;;
esac
done

DEB_REPO_PATHS=( "debian/bookworm"
Expand Down
Loading