|
| 1 | +# Special Dockerfile to build all targets, the only difference is |
| 2 | +# the packages in the base image. |
| 3 | +# Set this to the base image to use in each case, so if we want to build for rockylinux/8 |
| 4 | +# we would set BASE_BUILDER=rockylinux-8-base. |
| 5 | +ARG BASE_BUILDER |
| 6 | +# Lookup the name to use below but should follow the '<distro>-base' convention with slashes replaced. |
| 7 | +# Use buildkit to skip unused base images: DOCKER_BUILDKIT=1 |
| 8 | + |
| 9 | +# Multiarch support |
| 10 | +FROM multiarch/qemu-user-static:x86_64-aarch64 as multiarch-aarch64 |
| 11 | + |
| 12 | +# rockylinux/8 base image |
| 13 | +FROM rockylinux:8 as rockylinux-8-base |
| 14 | + |
| 15 | +# Add for the YAML development libraries |
| 16 | +RUN sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/Rocky-PowerTools.repo |
| 17 | + |
| 18 | +# hadolint ignore=DL3033 |
| 19 | +RUN yum -y update && \ |
| 20 | + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ |
| 21 | + wget unzip systemd-devel wget flex bison \ |
| 22 | + postgresql-libs postgresql-devel postgresql-server postgresql \ |
| 23 | + cyrus-sasl-lib openssl openssl-libs openssl-devel libyaml-devel && \ |
| 24 | + yum clean all |
| 25 | + |
| 26 | +# rockylinux/8.arm64v8 base image |
| 27 | +# hadolint ignore=DL3029 |
| 28 | +FROM --platform=arm64 rockylinux:8 as rockylinux-8.arm64v8-base |
| 29 | + |
| 30 | +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static |
| 31 | + |
| 32 | +# Add for the YAML development libraries |
| 33 | +RUN sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/Rocky-PowerTools.repo |
| 34 | + |
| 35 | +# hadolint ignore=DL3033 |
| 36 | +RUN yum -y update && \ |
| 37 | + yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ |
| 38 | + wget unzip systemd-devel wget flex bison \ |
| 39 | + postgresql-libs postgresql-devel postgresql-server postgresql \ |
| 40 | + cyrus-sasl-lib openssl openssl-libs openssl-devel libyaml-devel && \ |
| 41 | + yum clean all |
| 42 | + |
| 43 | +# Need larger page size |
| 44 | +ARG FLB_JEMALLOC_OPTIONS="--with-lg-page=16 --with-lg-quantum=3" |
| 45 | +ENV FLB_JEMALLOC_OPTIONS=$FLB_JEMALLOC_OPTIONS |
| 46 | + |
| 47 | +FROM rockylinux:9 as rockylinux-9-base |
| 48 | + |
| 49 | +# Add for the YAML development libraries |
| 50 | +RUN sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/rocky-devel.repo |
| 51 | + |
| 52 | +# hadolint ignore=DL3033 |
| 53 | +RUN yum -y update && \ |
| 54 | + yum install -y --allowerasing rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ |
| 55 | + wget unzip systemd-devel wget flex bison \ |
| 56 | + postgresql-libs postgresql-devel postgresql-server postgresql \ |
| 57 | + cyrus-sasl-lib openssl openssl-libs openssl-devel libyaml-devel && \ |
| 58 | + yum clean all |
| 59 | + |
| 60 | +# rockylinux/8.arm64v8 base image |
| 61 | +# hadolint ignore=DL3029 |
| 62 | +FROM --platform=arm64 rockylinux:9 as rockylinux-9.arm64v8-base |
| 63 | + |
| 64 | +COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static |
| 65 | + |
| 66 | +# Add for the YAML development libraries |
| 67 | +RUN sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/rocky-devel.repo |
| 68 | + |
| 69 | +# hadolint ignore=DL3033 |
| 70 | +RUN yum -y update && \ |
| 71 | + yum install -y --allowerasing rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \ |
| 72 | + wget unzip systemd-devel wget flex bison \ |
| 73 | + postgresql-libs postgresql-devel postgresql-server postgresql \ |
| 74 | + cyrus-sasl-lib openssl openssl-libs openssl-devel libyaml-devel && \ |
| 75 | + yum clean all |
| 76 | + |
| 77 | +# Need larger page size |
| 78 | +ARG FLB_JEMALLOC_OPTIONS="--with-lg-page=16 --with-lg-quantum=3" |
| 79 | +ENV FLB_JEMALLOC_OPTIONS=$FLB_JEMALLOC_OPTIONS |
| 80 | + |
| 81 | +# Common build for all distributions now |
| 82 | +# hadolint ignore=DL3006 |
| 83 | +FROM $BASE_BUILDER as builder |
| 84 | + |
| 85 | +ARG FLB_NIGHTLY_BUILD |
| 86 | +ENV FLB_NIGHTLY_BUILD=$FLB_NIGHTLY_BUILD |
| 87 | + |
| 88 | +# Docker context must be the base of the repo |
| 89 | +WORKDIR /source/fluent-bit/ |
| 90 | +COPY . ./ |
| 91 | + |
| 92 | +WORKDIR /source/fluent-bit/build/ |
| 93 | +# CMake configuration variables |
| 94 | +# Unused |
| 95 | +ARG CFLAGS |
| 96 | +ARG CMAKE_INSTALL_PREFIX=/opt/fluent-bit/ |
| 97 | +ARG CMAKE_INSTALL_SYSCONFDIR=/etc/ |
| 98 | +ARG FLB_RELEASE=On |
| 99 | +ARG FLB_TRACE=On |
| 100 | +ARG FLB_SQLDB=On |
| 101 | +ARG FLB_HTTP_SERVER=On |
| 102 | +ARG FLB_OUT_KAFKA=On |
| 103 | +ARG FLB_JEMALLOC=On |
| 104 | +ARG FLB_CHUNK_TRACE=On |
| 105 | +ARG FLB_UNICODE_ENCODER=On |
| 106 | +ARG FLB_KAFKA=On |
| 107 | +ARG FLB_OUT_PGSQL=On |
| 108 | + |
| 109 | +RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ |
| 110 | + -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ |
| 111 | + -DFLB_RELEASE="$FLB_RELEASE" \ |
| 112 | + -DFLB_TRACE="$FLB_TRACE" \ |
| 113 | + -DFLB_SQLDB="$FLB_SQLDB" \ |
| 114 | + -DFLB_HTTP_SERVER="$FLB_HTTP_SERVER" \ |
| 115 | + -DFLB_KAFKA="$FLB_KAFKA" \ |
| 116 | + -DFLB_OUT_PGSQL="$FLB_OUT_PGSQL" \ |
| 117 | + -DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \ |
| 118 | + -DFLB_JEMALLOC_OPTIONS="$FLB_JEMALLOC_OPTIONS" \ |
| 119 | + -DFLB_JEMALLOC="${FLB_JEMALLOC}" \ |
| 120 | + -DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \ |
| 121 | + -DFLB_UNICODE_ENCODER="${FLB_UNICODE_ENCODER}" \ |
| 122 | + ../ |
| 123 | + |
| 124 | +VOLUME [ "/output" ] |
| 125 | +CMD [ "/bin/bash", "-c", "make --no-print-directory -j 4 && cpack3 -G RPM && cp *.rpm /output/" ] |
0 commit comments