/
Dockerfile.NEXT
206 lines (199 loc) · 5.47 KB
/
Dockerfile.NEXT
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# container for rsyslog development
# creates the build environment
# Note: this image currently uses in-container git checkouts to
# build the "rsyslog libraries" - we do not have packages for them
FROM fedora:28
# search for packages that contain <file>: dnf whatprovides <file>
RUN dnf -y update && \
dnf -y install \
autoconf \
autoconf-archive \
automake \
bison \
clang \
clang-analyzer \
compat-libstdc++-33 \
curl \
cyrus-sasl-devel \
cyrus-sasl-lib \
czmq-devel \
flex \
gcc \
gdb \
git \
gnutls-devel \
hiredis \
hiredis-devel \
hiredis-devel \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
libcurl-devel \
libdbi-dbd-mysql \
libdbi-devel \
libfaketime \
libgcrypt-devel \
libmaxminddb \
libmaxminddb-devel \
libnet \
libnet-devel \
libpcap-devel \
libtool \
libuuid-devel \
lsof \
make \
mongo-c-driver \
mongo-c-driver-devel \
mysql-devel \
nc \
net-snmp-devel \
net-tools \
openssl-devel \
postgresql-devel \
python-devel \
python-docutils \
python-sphinx \
qpid-proton-c-devel \
redhat-rpm-config \
snappy-devel \
sudo \
systemd-devel \
tcl-devel \
valgrind \
wget \
zlib-devel
# end of this RUN
# unfortunately, tcl-devel does not properly setup required bits in the environment
# so we now try to do that. In case this does no longer work with a version, search
# for a file tclConfig.sh, which should be present in the library directory (usually
# beneath /usr). It contains the environment variables. Inside container do:
# $cat $(find /usr -name tclConfig.sh|head -n1)
ENV TCL_LIB_SPEC="-L/usr/lib64 -ltcl8.6" \
TCL_INCLUDE_SPEC=-I/usr/include
# create dependency cache
RUN mkdir /local_dep_cache && \
wget -nv https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.9.tar.gz -O /local_dep_cache/elasticsearch-5.6.9.tar.gz && \
wget -nv https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.tar.gz -O /local_dep_cache/elasticsearch-6.0.0.tar.gz && \
wget -nv https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.1.tar.gz -O /local_dep_cache/elasticsearch-6.3.1.tar.gz
# tell tests which are the newester versions, so they can be checked without the need
# to adjust test sources.
ENV ELASTICSEARCH_NEWEST="elasticsearch-6.3.1.tar.gz"
WORKDIR /home/devel
VOLUME /rsyslog
RUN groupadd rsyslog \
&& adduser -g rsyslog -s /bin/bash rsyslog \
&& echo "rsyslog ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ADD setup-system.sh setup-system.sh
ADD common/setup-projects.sh setup-projects.sh
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig \
LD_LIBRARY_PATH=/usr/local/lib \
LIBDIR_PATH=/usr/lib64
# bump dependency version below to trigger a dependency rebuild
# but not a full one (via --no-cache)
ENV DEP_VERSION=1
# Helper projects and dependency build starts here
RUN mkdir helper-projects
# code style checker - not yet packaged
RUN cd helper-projects && \
git clone https://github.com/rsyslog/codestyle && \
cd codestyle && \
gcc --std=c99 stylecheck.c -o stylecheck && \
mv stylecheck /usr/bin/rsyslog_stylecheck && \
cd .. && \
rm -r codestyle && \
cd ..
# we need Guardtime libksi here, otherwise we cannot check the KSI component
RUN cd helper-projects && \
git clone https://github.com/guardtime/libksi.git && \
cd libksi && \
autoreconf -fvi && \
./configure --libdir=/usr/lib64 && \
make -j2 && \
make install && \
cd .. && \
rm -r libksi && \
cd ..
# we need the latest librdkafka as there as always required updates
RUN cd helper-projects && \
git clone https://github.com/edenhill/librdkafka && \
cd librdkafka && \
(unset CFLAGS; ./configure --prefix=/usr --libdir=$LIBDIR_PATH --CFLAGS="-g" ; make -j2) && \
make install && \
cd .. && \
# Note: we do NOT delete the source as we may need it to
# uninstall (in case the user wants to go back to system-default)
cd ..
# next ENV is specifically for running scan-build - so we do not need to
# change scripts if at a later time we can move on to a newer version
#ENV SCAN_BUILD=scan-build \
# SCAN_BUILD_CC=clang-5.0
ENV RSYSLOG_CONFIGURE_OPTIONS \
--enable-elasticsearch \
--enable-elasticsearch-tests \
--enable-gnutls \
--enable-gssapi-krb5 \
--enable-imczmq \
--enable-imdiag \
--enable-imfile \
--enable-imjournal \
--enable-imkafka \
--enable-impstats \
--enable-impcap \
--enable-imptcp \
--enable-kafka-tests \
--enable-ksi-ls12 \
--enable-libdbi \
--enable-libfaketime \
--enable-libgcrypt \
--enable-mail \
--enable-mmanon \
--enable-mmaudit \
--enable-mmcapture \
--enable-mmcount \
--enable-mmdblookup \
--enable-mmfields \
--enable-mmjsonparse \
--enable-mmkubernetes \
--enable-mmnormalize \
--enable-mmpstrucdata \
--enable-mmrm1stspace \
--enable-mmsequence \
--enable-mmsnmptrapd \
--enable-mmutf8fix \
--enable-mysql \
--enable-omamqp1 \
--enable-omczmq \
--enable-omhiredis \
--enable-omhiredis \
--enable-omhtt \
--enable-omhttpfs \
--enable-omjournal \
--enable-omkafka \
--enable-ommongodb \
--enable-omprog \
--enable-omrelp-default-port=13515 \
--enable-omruleset \
--enable-omstdout \
--enable-omtcl \
--enable-omudpspoof \
--enable-omuxsock \
--enable-openssl \
--enable-pgsql \
--enable-pmaixforwardedfrom \
--enable-pmciscoios \
--enable-pmcisconames \
--enable-pmlastmsg \
--enable-pmnormalize \
--enable-pmnull \
--enable-pmsnare \
--enable-relp \
--enable-snmp \
--enable-usertools \
--enable-valgrind \
\
--enable-testbench
# build errors at the moment: --enable-kmsg
# --enable-mmgrok - no package
# Install any needed packages
RUN ./setup-projects.sh
WORKDIR /rsyslog
USER rsyslog