Skip to content
Open
22 changes: 22 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,25 @@ 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|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/suse/\$releasever
gpgcheck=1
repo_gpgcheck=1
gpgkey=$RELEASE_KEY
enabled=1
type=rpm-md
autorefresh=1
EOF
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
74 changes: 74 additions & 0 deletions packaging/distros/opensuse/15.6.arm64v8/Dockerfile
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need this as it should be part of the opensuse/Dockerfile?

Copy link
Author

Choose a reason for hiding this comment

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

I had an issue with docker finding the correct base image when trying to set the specific leap versions. So if using the opensuse/Dockerfile and setting the target to something like
./packaging/build.sh -d opensuse/leap:15.6
Then the build.sh will add a -base to the image name, opensuse/leap:15.6-base, which does not exist for opensuse. The standard naming convention is opensuse/leap:15.6 which is already the minimal image.

I wasnt sure how to correctly get around this, I can also add a check in build.sh if DISTRO is opensuse to not append the -base. Or maybe there is another way I am not understanding

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Multiarch support
FROM multiarch/qemu-user-static:x86_64-aarch64 as multiarch-aarch64

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

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

# hadolint ignore=DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake3-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/*
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

cmake3-full doesn’t exist in Leap 15.x repos

zypper install … cmake3-full will fail because the package name in Leap/SLES is cmake (with the optional cmake-full pattern), not cmake3-full. The Docker build will therefore break before we even reach CMake configure. Please swap in the correct package name (typically cmake or cmake-full) so the image can install successfully.

🤖 Prompt for AI Agents
In packaging/distros/opensuse/15.6.arm64v8/Dockerfile around lines 11-24, the
Dockerfile attempts to install a non-existent package named cmake3-full on Leap
15.x; replace cmake3-full with the correct package name (typically cmake or the
cmake-full pattern) in the zypper install line so the install succeeds, then
rebuild the image to verify CMake is available.


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

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_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/" ]
69 changes: 69 additions & 0 deletions packaging/distros/opensuse/15.6/Dockerfile
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need this as it should be part of the opensuse/Dockerfile?

Copy link
Author

Choose a reason for hiding this comment

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

I think i discovered the problem i had on why i thought i needed multiple Dockerfiles. The build.sh needs to be updated to replace : with - if i want to call ./build.sh -d opensuse/leap:15.6. I'll push an update to remove the extra Dockerfiles.

Is there a preference on the name we will pass the target distro to build.sh?
./build.sh -d opensuse/leap:15.6
or
./build.sh -d opensuse/leap-15.6
or
./build.sh -d opensuse/15.6

opensuse/leap:15.6 makes sense to me and I can make a change to build.sh to replace : with - to make sure its a valid stage name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we've typically done the os/version approach in the past - you can see with centos for example the actual base images are stream now but we kept the old name for consistency.

I would probably just go with opensuse/15.6 for now to keep it simple - otherwise we start running into making typos or trying to use non-leap versions, etc.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Multiarch support
# Builder/Final (per-arch) stages
FROM opensuse/leap:15.6 AS opensuse-leap-base

# hadolint ignore=DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake3-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

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_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/" ]
106 changes: 106 additions & 0 deletions packaging/distros/opensuse/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# 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
FROM opensuse/leap AS opensuse-leap-base

# hadolint ignore=DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake3-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=DL3029
FROM --platform=arm64 opensuse/leap:15.6 AS opensuse-leap.arm64v8-base

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

# hadolint ignore=DL3033
RUN zypper up -y && \
zypper install -y --no-recommends \
rpm-build \
curl ca-certificates wget unzip flex bison \
gcc gcc-c++ \
cmake3-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
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_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/" ]
Loading