diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:57:58 +0000 |
commit | be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /fluent-bit/packaging/distros | |
parent | Initial commit. (diff) | |
download | netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip |
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/packaging/distros')
-rw-r--r-- | fluent-bit/packaging/distros/amazonlinux/Dockerfile | 103 | ||||
-rw-r--r-- | fluent-bit/packaging/distros/centos/Dockerfile | 181 | ||||
-rw-r--r-- | fluent-bit/packaging/distros/debian/Dockerfile | 136 | ||||
-rw-r--r-- | fluent-bit/packaging/distros/raspbian/Dockerfile | 77 | ||||
-rw-r--r-- | fluent-bit/packaging/distros/ubuntu/Dockerfile | 165 |
5 files changed, 662 insertions, 0 deletions
diff --git a/fluent-bit/packaging/distros/amazonlinux/Dockerfile b/fluent-bit/packaging/distros/amazonlinux/Dockerfile new file mode 100644 index 00000000..fa9b17c5 --- /dev/null +++ b/fluent-bit/packaging/distros/amazonlinux/Dockerfile @@ -0,0 +1,103 @@ +# Special Dockerfile to build all Ubuntu targets, the only difference is +# the packages in the base image. +# Set this to the base image to use in each case, so if we want to build for amazonlinux/2.arm64v8 +# we would set BASE_BUILDER=amazonlinux-2.arm64v8-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 + +# amazonlinux/2 base image +FROM amazonlinux:2 as amazonlinux-2-base + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ + postgresql-devel postgresql-libs \ + cmake3 libyaml-devel zlib-devel && \ + yum clean all + +# amazonlinux/2.arm64v8 base image +FROM arm64v8/amazonlinux:2 as amazonlinux-2.arm64v8-base + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ + postgresql-devel postgresql-libs \ + cmake3 libyaml-devel zlib-devel && \ + yum clean all + +FROM amazonlinux:2023 as amazonlinux-2023-base + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel \ + postgresql-devel postgresql-libs \ + cmake3 libyaml-devel zlib-devel && \ + yum clean all + +# hadolint ignore=DL3029 +FROM --platform=arm64 amazonlinux:2023 as amazonlinux-2023.arm64v8-base + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel \ + postgresql-devel postgresql-libs \ + cmake3 libyaml-devel zlib-devel && \ + yum clean all + +# 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 /tmp/fluent-bit/ +COPY . ./ + +WORKDIR /tmp/fluent-bit/build/ +# CMake configuration variables +# Unused +ARG CFLAGS +ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/ +ARG CMAKE_INSTALL_SYSCONFDIR=/etc/ +ARG FLB_RELEASE=On +ARG FLB_TRACE=On +ARG FLB_SQLDB=On +ARG FLB_HTTP_SERVER=On +ARG FLB_OUT_KAFKA=On +ARG FLB_OUT_PGSQL=On +ARG FLB_JEMALLOC=On +ARG FLB_CHUNK_TRACE=On + +RUN cmake3 -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ + -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ + -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_OUT_PGSQL="$FLB_OUT_PGSQL" \ + -DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \ + -DFLB_JEMALLOC="${FLB_JEMALLOC}" \ + -DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \ + ../ + +VOLUME [ "/output" ] +CMD [ "/bin/bash", "-c", "make -j 4 && cpack3 -G RPM && cp *.rpm /output/" ] diff --git a/fluent-bit/packaging/distros/centos/Dockerfile b/fluent-bit/packaging/distros/centos/Dockerfile new file mode 100644 index 00000000..0954659f --- /dev/null +++ b/fluent-bit/packaging/distros/centos/Dockerfile @@ -0,0 +1,181 @@ +# Special Dockerfile to build all CentOS targets, the only difference is +# the packages in the base image. +# Set this to the base image to use in each case, so if we want to build for centos/7 +# we would set BASE_BUILDER=centos-7-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 + +# centos/7 base image +FROM centos:7 as centos-7-base + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ + postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel && \ + wget -q http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ + rpm -ivh epel-release-latest-7.noarch.rpm && \ + yum install -y cmake3 && \ + yum clean all + +ARG FLB_OUT_PGSQL=On +ENV FLB_OUT_PGSQL=$FLB_OUT_PGSQL + +# centos/7.arm64v8 base image +FROM arm64v8/centos:7 as centos-7.arm64v8-base + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel \ + postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel && \ + wget -q http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ + rpm -ivh epel-release-latest-7.noarch.rpm && \ + yum install -y cmake3 && \ + yum clean all + +# There are no postgresql libraries available for this target +ARG FLB_OUT_PGSQL=Off +ENV FLB_OUT_PGSQL=$FLB_OUT_PGSQL + +# Need larger page size +ARG FLB_JEMALLOC_OPTIONS="--with-lg-page=16 --with-lg-quantum=3" +ENV FLB_JEMALLOC_OPTIONS=$FLB_JEMALLOC_OPTIONS + +# centos/8 base image +FROM centos:8 as centos-8-base + +# CentOS is now EOL so have to use the vault repos +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + +# Add for the YAML development libraries +RUN sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Linux-PowerTools.repo + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + postgresql-libs postgresql-devel postgresql-server postgresql \ + cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel \ + libyaml-devel zlib-devel && \ + yum clean all + +ARG FLB_OUT_PGSQL=On +ENV FLB_OUT_PGSQL=$FLB_OUT_PGSQL + +# centos/8.arm64v8 base image +FROM arm64v8/centos:8 as centos-8.arm64v8-base + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# CentOS is now EOL so have to use the vault repos +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + +# Add for the YAML development libraries +RUN sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Linux-PowerTools.repo + +# hadolint ignore=DL3033 +RUN yum -y update && \ + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + postgresql-libs postgresql-devel postgresql-server postgresql \ + cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel \ + libyaml-devel zlib-devel && \ + yum clean all + +ARG FLB_OUT_PGSQL=On +ENV FLB_OUT_PGSQL=$FLB_OUT_PGSQL + +# Need larger page size +ARG FLB_JEMALLOC_OPTIONS="--with-lg-page=16 --with-lg-quantum=3" +ENV FLB_JEMALLOC_OPTIONS=$FLB_JEMALLOC_OPTIONS + +FROM quay.io/centos/centos:stream9 as centos-9-base + +# Add for the YAML development libraries +# hadolint ignore=DL3033,DL3041 +RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled crb && \ + dnf -y install rpm-build ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + postgresql-libs postgresql-devel postgresql-server postgresql \ + cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel \ + libyaml-devel zlib-devel && \ + dnf clean all + +ARG FLB_OUT_PGSQL=On +ENV FLB_OUT_PGSQL=$FLB_OUT_PGSQL + +# hadolint ignore=DL3029 +FROM --platform=arm64 quay.io/centos/centos:stream9 as centos-9.arm64v8-base + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# Add for the YAML development libraries +# hadolint ignore=DL3033,DL3041 +RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled crb && \ + dnf -y install rpm-build ca-certificates gcc gcc-c++ cmake make bash \ + wget unzip systemd-devel wget flex bison \ + postgresql-libs postgresql-devel postgresql-server postgresql \ + cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel \ + libyaml-devel zlib-devel && \ + dnf clean all + +ARG FLB_OUT_PGSQL=On +ENV FLB_OUT_PGSQL=$FLB_OUT_PGSQL + +# 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 /tmp/fluent-bit/ +COPY . ./ + +WORKDIR /tmp/fluent-bit/build/ +# CMake configuration variables +# Unused +ARG CFLAGS +ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/ +ARG CMAKE_INSTALL_SYSCONFDIR=/etc/ +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 + +# cmake3 exists in every image - cmake references the older cmake2 in centos 7 +RUN cmake3 -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ + -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ + -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_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}" \ + ../ + +VOLUME [ "/output" ] +CMD [ "/bin/bash", "-c", "make -j 4 && cpack3 -G RPM && cp *.rpm /output/" ] diff --git a/fluent-bit/packaging/distros/debian/Dockerfile b/fluent-bit/packaging/distros/debian/Dockerfile new file mode 100644 index 00000000..d3787150 --- /dev/null +++ b/fluent-bit/packaging/distros/debian/Dockerfile @@ -0,0 +1,136 @@ +# Special Dockerfile to build all Debian targets, the only difference is +# the packages in the base image. +# Set this to the base image to use in each case, so if we want to build for debian/bullseye +# we would set BASE_BUILDER=debian-bullseye-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 + +# debian/buster base image +FROM debian:buster-slim as debian-buster-base +ENV DEBIAN_FRONTEND noninteractive + +# hadolint ignore=DL3008,DL3015 +RUN apt-get -qq update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl1.1 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# debian/buster.arm64v8 base image +FROM arm64v8/debian:buster-slim as debian-buster.arm64v8-base +ENV DEBIAN_FRONTEND noninteractive + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3008,DL3015 +RUN apt-get -qq update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl1.1 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# debian/bullseye base image +FROM debian:bullseye-slim as debian-bullseye-base +ENV DEBIAN_FRONTEND noninteractive + +# hadolint ignore=DL3008,DL3015 +RUN apt-get -qq update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl1.1 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# debian/bullseye.arm64v8 base image +FROM arm64v8/debian:bullseye-slim as debian-bullseye.arm64v8-base +ENV DEBIAN_FRONTEND noninteractive + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3008,DL3015 +RUN apt-get -qq update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl1.1 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# debian/bookworm base image +FROM debian:bookworm-slim as debian-bookworm-base +ENV DEBIAN_FRONTEND noninteractive + +# hadolint ignore=DL3008,DL3015 +RUN apt-get -qq update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl3 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# debian/bookworm.arm64v8 base image +FROM arm64v8/debian:bookworm-slim as debian-bookworm.arm64v8-base +ENV DEBIAN_FRONTEND noninteractive + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3008,DL3015 +RUN apt-get -qq update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl3 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# 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 /tmp/fluent-bit/ +COPY . ./ + +WORKDIR /tmp/fluent-bit/build/ +# CMake configuration variables +ARG CFLAGS="-std=gnu99" +ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/ +ARG CMAKE_INSTALL_SYSCONFDIR=/etc/ +ARG FLB_RELEASE=On +ARG FLB_TRACE=On +ARG FLB_SQLDB=On +ARG FLB_HTTP_SERVER=On +ARG FLB_OUT_KAFKA=On +ARG FLB_OUT_PGSQL=On +ARG FLB_JEMALLOC=On +ARG FLB_CHUNK_TRACE=On + +ENV CFLAGS=$CFLAGS +RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ + -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ + -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_OUT_PGSQL="$FLB_OUT_PGSQL" \ + -DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \ + -DFLB_JEMALLOC="${FLB_JEMALLOC}" \ + -DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \ + ../ + +VOLUME [ "/output" ] +CMD [ "/bin/bash", "-c", "make -j 4 && cpack -G DEB && cp *.deb /output/" ] diff --git a/fluent-bit/packaging/distros/raspbian/Dockerfile b/fluent-bit/packaging/distros/raspbian/Dockerfile new file mode 100644 index 00000000..03ca9708 --- /dev/null +++ b/fluent-bit/packaging/distros/raspbian/Dockerfile @@ -0,0 +1,77 @@ +# Special Dockerfile to build all Ubuntu targets, the only difference is +# the packages in the base image. +# Set this to the base image to use in each case, so if we want to build for ubuntu/20.04 +# we would set BASE_BUILDER=ubuntu-20.04-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 + +FROM balenalib/rpi-raspbian:buster as raspbian-buster-base +ENV DEBIAN_FRONTEND noninteractive + +# Builder image so dependencies can be latest, recommended and no need to wipe +# We pin cmake to a working version (latest 3.16 triggers cmake failures for GNU C compiler detection) +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y cmake=3.13.4-1 cmake-data=3.13.4-1 \ + curl ca-certificates build-essential \ + make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl1.1 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# raspbian/bullseye base image +FROM balenalib/rpi-raspbian:bullseye as raspbian-bullseye-base +ENV DEBIAN_FRONTEND noninteractive + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates build-essential \ + cmake make bash sudo wget unzip dh-make \ + libsystemd-dev zlib1g-dev flex bison \ + libssl1.1 libssl-dev libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev libyaml-dev pkg-config && \ + apt-get install -y --reinstall lsb-base lsb-release + +# 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 /tmp/fluent-bit/ +COPY . ./ + +WORKDIR /tmp/fluent-bit/build/ +# CMake configuration variables +ARG CFLAGS="-std=gnu99" +ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/ +ARG CMAKE_INSTALL_SYSCONFDIR=/etc/ +ARG FLB_RELEASE=On +ARG FLB_TRACE=On +ARG FLB_SQLDB=On +ARG FLB_HTTP_SERVER=On +ARG FLB_OUT_KAFKA=On +ARG FLB_OUT_PGSQL=On +ARG FLB_JEMALLOC=On +ARG FLB_CHUNK_TRACE=On + +ENV CFLAGS=$CFLAGS +RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ + -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ + -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_OUT_PGSQL="$FLB_OUT_PGSQL" \ + -DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \ + -DFLB_JEMALLOC="${FLB_JEMALLOC}" \ + -DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \ + ../ + +VOLUME [ "/output" ] +CMD [ "/bin/bash", "-c", "make -j 4 && cpack -G DEB && cp *.deb /output/" ] diff --git a/fluent-bit/packaging/distros/ubuntu/Dockerfile b/fluent-bit/packaging/distros/ubuntu/Dockerfile new file mode 100644 index 00000000..40272f8f --- /dev/null +++ b/fluent-bit/packaging/distros/ubuntu/Dockerfile @@ -0,0 +1,165 @@ +# Special Dockerfile to build all Ubuntu targets, the only difference is +# the packages in the base image. +# Set this to the base image to use in each case, so if we want to build for ubuntu/20.04 +# we would set BASE_BUILDER=ubuntu-20.04-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 + +# ubuntu/16.04 base image +FROM ubuntu:16.04 as ubuntu-16.04-base +ENV DEBIAN_FRONTEND noninteractive + +# Using pipe below +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates build-essential libsystemd-dev cmake \ + make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all software-properties-common \ + software-properties-common libyaml-dev apt-transport-https \ + pkg-config libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.0 zlib1g-dev && \ + wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \ + gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main' && \ + apt-get update && \ + apt-get install -y --reinstall lsb-base lsb-release cmake + +# ubuntu/18.04 base image +FROM ubuntu:18.04 as ubuntu-18.04-base +ENV DEBIAN_FRONTEND noninteractive +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates gcc-8 g++-8 libsystemd-dev \ + cmake make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 \ + software-properties-common libyaml-dev apt-transport-https pkg-config zlib1g-dev && \ + wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \ + gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \ + apt-get update && \ + apt-get install -y --reinstall lsb-base lsb-release cmake && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 1 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 1 + +# ubuntu/18.04.arm64v8 base image +FROM arm64v8/ubuntu:18.04 as ubuntu-18.04.arm64v8-base +ENV DEBIAN_FRONTEND noninteractive +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates gcc-8 g++-8 libsystemd-dev \ + cmake make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 \ + software-properties-common libyaml-dev apt-transport-https pkg-config zlib1g-dev && \ + wget -q -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \ + gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \ + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \ + apt-get update && \ + apt-get install -y --reinstall lsb-base lsb-release cmake && \ + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 1 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 1 + +# ubuntu/20.04 base image +FROM ubuntu:20.04 as ubuntu-20.04-base +ENV DEBIAN_FRONTEND noninteractive + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates build-essential libsystemd-dev \ + cmake make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 libyaml-dev pkg-config zlib1g-dev && \ + apt-get install -y --reinstall lsb-base lsb-release + +# ubuntu/20.04.arm64v8 base image +FROM arm64v8/ubuntu:20.04 as ubuntu-20.04.arm64v8-base +ENV DEBIAN_FRONTEND noninteractive + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates build-essential libsystemd-dev \ + cmake make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all \ + libsasl2-2 libsasl2-dev openssl libssl-dev libssl1.1 libyaml-dev pkg-config zlib1g-dev && \ + apt-get install -y --reinstall lsb-base lsb-release + +# ubuntu/22.04 base image +FROM ubuntu:22.04 as ubuntu-22.04-base +ENV DEBIAN_FRONTEND noninteractive + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates build-essential libsystemd-dev \ + cmake make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all libpq5 \ + libsasl2-2 libsasl2-dev openssl libssl-dev libssl3 libyaml-dev pkg-config zlib1g-dev && \ + apt-get install -y --reinstall lsb-base lsb-release + +# ubuntu/22.04.arm64v8 base image +FROM arm64v8/ubuntu:22.04 as ubuntu-22.04.arm64v8-base +ENV DEBIAN_FRONTEND noninteractive + +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static + +# hadolint ignore=DL3008,DL3015 +RUN apt-get update && \ + apt-get install -y curl ca-certificates build-essential libsystemd-dev \ + cmake make bash wget unzip nano vim valgrind dh-make flex bison \ + libpq-dev postgresql-server-dev-all libpq5 \ + libsasl2-2 libsasl2-dev openssl libssl-dev libssl3 libyaml-dev pkg-config zlib1g-dev && \ + apt-get install -y --reinstall lsb-base lsb-release + +# 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 /tmp/fluent-bit/ +COPY . ./ + +WORKDIR /tmp/fluent-bit/build/ +# CMake configuration variables +ARG CFLAGS="-std=gnu99" +ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/ +ARG CMAKE_INSTALL_SYSCONFDIR=/etc/ +ARG FLB_RELEASE=On +ARG FLB_TRACE=On +ARG FLB_SQLDB=On +ARG FLB_HTTP_SERVER=On +ARG FLB_OUT_KAFKA=On +ARG FLB_OUT_PGSQL=On +ARG FLB_JEMALLOC=On +ARG FLB_CHUNK_TRACE=On + +ENV CFLAGS=$CFLAGS +RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ + -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ + -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_OUT_PGSQL="$FLB_OUT_PGSQL" \ + -DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \ + -DFLB_JEMALLOC="${FLB_JEMALLOC}" \ + -DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \ + ../ + +VOLUME [ "/output" ] +CMD [ "/bin/bash", "-c", "make -j 4 && cpack -G DEB && cp *.deb /output/" ] |