forked from SumoLogic/sumologic-openshift-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
87 lines (71 loc) · 2.24 KB
/
Dockerfile
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
ARG UPSTREAM_VERSION
FROM registry.access.redhat.com/ubi9/ubi:9.4 as builder
ARG UPSTREAM_VERSION
ARG BISON_VERSION=3.8.2
ARG FLEX_VERSION=2.6.4
RUN dnf update -y && \
dnf install -y cmake \
diffutils \
gcc \
gcc-c++ \
libpq-devel \
m4 \
make \
openssl-devel \
systemd-devel \
tar \
unzip \
wget \
libyaml-devel && \
dnf clean all
RUN wget http://ftp.gnu.org/gnu/bison/bison-${BISON_VERSION}.tar.gz && \
tar -xzvf bison-${BISON_VERSION}.tar.gz && \
cd bison*/ && \
./configure && \
make && \
make install
RUN wget https://github.com/westes/flex/files/981163/flex-${FLEX_VERSION}.tar.gz && \
tar -xzvf flex-${FLEX_VERSION}.tar.gz && \
cd flex*/ && \
./configure && \
make && \
make install
RUN mkdir -p /fluent-bit/bin /fluent-bit/etc /fluent-bit/log /tmp/src/
RUN wget https://github.com/fluent/fluent-bit/archive/refs/tags/v${UPSTREAM_VERSION}.tar.gz && \
tar -xzvf v${UPSTREAM_VERSION}.tar.gz -C /tmp/src/ --strip-components=1 && \
rm v${UPSTREAM_VERSION}.tar.gz
WORKDIR /tmp/src/build/
RUN cmake -DFLB_DEBUG=Off \
-DFLB_TRACE=Off \
-DFLB_JEMALLOC=On \
-DFLB_TLS=On \
-DFLB_SHARED_LIB=Off \
-DFLB_EXAMPLES=Off \
-DFLB_HTTP_SERVER=On \
-DFLB_IN_SYSTEMD=On \
-DFLB_OUT_KAFKA=On \
-DFLB_OUT_PGSQL=On ../
RUN make -j $(getconf _NPROCESSORS_ONLN)
RUN install bin/fluent-bit /fluent-bit/bin/
# Configuration files
RUN cp /tmp/src/conf/*.conf /fluent-bit/etc/
## Build RedHat compliant image
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
ARG UPSTREAM_VERSION
ARG RELEASE
ENV SUMMARY="UBI based Fluent Bit image" \
DESCRIPTION="Fluent Bit is a fast Log Processor and Forwarder"
LABEL name="Fluent Bit" \
vendor="Sumo Logic" \
version="${UPSTREAM_VERSION}" \
release="${RELEASE}" \
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
maintainer="[email protected]"
RUN microdnf update -y && microdnf install -y openssl libpq systemd && microdnf clean all
COPY --from=builder /fluent-bit /fluent-bit
COPY --from=builder /tmp/src/LICENSE /licenses/
EXPOSE 2020
USER nobody
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.conf"]