forked from mailserver2/debian-mail-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·124 lines (118 loc) · 4.38 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
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
FROM debian:12.4-slim
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_CORES
ARG SKALIBS_VER=2.14.0.1
ARG EXECLINE_VER=2.9.4.0
ARG S6_VER=2.12.0.2
ARG RSPAMD_VER=3.7.5
ARG GUCCI_VER=1.6.10
ARG SKALIBS_SHA256_HASH="b43ebdb36f8a8df40f1a08c13b08393bce49faf334e62a0db919b3ae4afd1488"
ARG EXECLINE_SHA256_HASH="9ab55d561539dfa76ff4a97906fa995fc4a288e3de5225cb1a9d8fa9e9ebc49b"
ARG S6_SHA256_HASH="aa917effe12ae97379090f75fda49f0d5f0f67cd65543684cff06dc881728f8c"
ARG RSPAMD_SHA256_HASH="3fba8b0086fe68ac16146cfc25cfcff352bff52fa5cef7d277007ed008170330"
ARG GUCCI_SHA256_HASH="d668ef080e1833591a85a051cd42b679a19ebcaf2c0449190523c7474ea1987e"
LABEL description="s6 + rspamd image based on Debian" \
maintainer="Hardware <[email protected]>" \
rspamd_version="Rspamd v$RSPAMD_VER built from source" \
s6_version="s6 v$S6_VER built from source"
ENV LC_ALL=C
RUN NB_CORES=${BUILD_CORES-$(getconf _NPROCESSORS_CONF)} \
&& BUILD_DEPS=" \
cmake \
gcc \
g++ \
make \
ragel \
wget \
pkg-config \
liblua5.1-0-dev \
libluajit-5.1-dev \
libglib2.0-dev \
libevent-dev \
libsqlite3-dev \
libicu-dev \
libssl-dev \
libhyperscan-dev \
libjemalloc-dev \
libmagic-dev \
libsodium-dev" \
&& apt-get update && apt-get dist-upgrade -y \
&& apt-get install -y -q --no-install-recommends \
${BUILD_DEPS} \
libevent-2.1-7 \
libglib2.0-0 \
libssl3 \
libmagic1 \
liblua5.1-0 \
libluajit-5.1-2 \
libsqlite3-0 \
libhyperscan5 \
libjemalloc2 \
libsodium23 \
sqlite3 \
openssl \
ca-certificates \
gnupg \
dirmngr \
netcat-openbsd \
&& cd /tmp \
&& SKALIBS_TARBALL="skalibs-${SKALIBS_VER}.tar.gz" \
&& wget -q https://skarnet.org/software/skalibs/${SKALIBS_TARBALL} \
&& CHECKSUM=$(sha256sum ${SKALIBS_TARBALL} | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${SKALIBS_SHA256_HASH}" ]; then echo "${SKALIBS_TARBALL} : bad checksum" && exit 1; fi \
&& tar xzf ${SKALIBS_TARBALL} && cd skalibs-${SKALIBS_VER} \
&& ./configure --prefix=/usr --datadir=/etc \
&& make && make install \
&& cd /tmp \
&& EXECLINE_TARBALL="execline-${EXECLINE_VER}.tar.gz" \
&& wget -q https://skarnet.org/software/execline/${EXECLINE_TARBALL} \
&& CHECKSUM=$(sha256sum ${EXECLINE_TARBALL} | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${EXECLINE_SHA256_HASH}" ]; then echo "${EXECLINE_TARBALL} : bad checksum" && exit 1; fi \
&& tar xzf ${EXECLINE_TARBALL} && cd execline-${EXECLINE_VER} \
&& ./configure --prefix=/usr --libdir=/usr/local/lib/ \
&& make && make install \
&& cd /tmp \
&& S6_TARBALL="s6-${S6_VER}.tar.gz" \
&& wget -q https://skarnet.org/software/s6/${S6_TARBALL} \
&& CHECKSUM=$(sha256sum ${S6_TARBALL} | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${S6_SHA256_HASH}" ]; then echo "${S6_TARBALL} : bad checksum" && exit 1; fi \
&& tar xzf ${S6_TARBALL} && cd s6-${S6_VER} \
&& ./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin \
&& make && make install \
&& cd /tmp \
&& RSPAMD_TARBALL="${RSPAMD_VER}.tar.gz" \
&& wget -q https://github.com/rspamd/rspamd/archive/${RSPAMD_TARBALL} \
&& CHECKSUM=$(sha256sum ${RSPAMD_TARBALL} | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${RSPAMD_SHA256_HASH}" ]; then echo "${RSPAMD_TARBALL} : bad checksum" && exit 1; fi \
&& tar xzf ${RSPAMD_TARBALL} && cd rspamd-${RSPAMD_VER} \
&& cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCONFDIR=/etc/rspamd \
-DRUNDIR=/run/rspamd \
-DDBDIR=/var/mail/rspamd \
-DLOGDIR=/var/log/rspamd \
-DPLUGINSDIR=/usr/share/rspamd \
-DLIBDIR=/usr/lib/rspamd \
-DNO_SHARED=ON \
-DWANT_SYSTEMD_UNITS=OFF \
-DENABLE_TORCH=ON \
-DENABLE_HIREDIS=ON \
-DINSTALL_WEBUI=ON \
-DENABLE_OPTIMIZATION=ON \
-DENABLE_HYPERSCAN=ON \
-DENABLE_JEMALLOC=ON \
-DJEMALLOC_ROOT_DIR=/jemalloc \
. \
&& make -j${NB_CORES} \
&& make install \
&& cd /tmp \
&& GUCCI_BINARY="gucci-v${GUCCI_VER}-linux-amd64" \
&& wget -q https://github.com/noqcks/gucci/releases/download/${GUCCI_VER}/${GUCCI_BINARY} \
&& CHECKSUM=$(sha256sum ${GUCCI_BINARY} | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${GUCCI_SHA256_HASH}" ]; then echo "${GUCCI_BINARY} : bad checksum" && exit 1; fi \
&& chmod +x ${GUCCI_BINARY} \
&& mv ${GUCCI_BINARY} /usr/local/bin/gucci \
&& apt-get purge -y ${BUILD_DEPS} \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/debconf/*-old