summaryrefslogtreecommitdiffstats
path: root/fluent-bit/packaging/distros/debian/Dockerfile
blob: d37871501ccb951494934da896c5f27b9fa24f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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/" ]