-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
133 lines (124 loc) · 4.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
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
FROM ubuntu:22.04 AS base
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_CORES
ARG SKALIBS_VER=2.13.1.1
ARG EXECLINE_VER=2.9.3.0
ARG S6_VER=2.11.3.2
ARG RSPAMD_VER=3.6
ARG GUCCI_VER=1.6.10
LABEL description="s6 + rspamd image based on Ubuntu" \
maintainer="Ali Khadivi <khadiviali39@gmail.com>" \
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 \
libsodium-dev \
libhyperscan-dev \
libjemalloc-dev \
libmagic-dev" \
&& apt-get update && 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 \
sqlite3 \
openssl \
ca-certificates \
gnupg \
dirmngr \
netcat \
&& cd /tmp \
&& SKALIBS_TARBALL="skalibs-${SKALIBS_VER}.tar.gz" \
&& wget -q https://skarnet.org/software/skalibs/${SKALIBS_TARBALL} \
&& 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} \
&& tar xzf ${EXECLINE_TARBALL} && cd execline-${EXECLINE_VER} \
&& ./configure --prefix=/usr \
&& make && make install \
&& cd /tmp \
&& S6_TARBALL="s6-${S6_VER}.tar.gz" \
&& wget -q https://skarnet.org/software/s6/${S6_TARBALL} \
&& 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/refs/tags/${RSPAMD_TARBALL} \
&& 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} \
&& 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
FROM base AS final
LABEL description="Simple and full-featured mail server using Docker" \
maintainer="Ali Khadivi <khadiviali39@gmail.com>"
ARG DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y -q --no-install-recommends \
postfix postfix-pgsql postfix-mysql postfix-ldap postfix-pcre libsasl2-modules \
dovecot-core dovecot-imapd dovecot-lmtpd dovecot-pgsql dovecot-mysql dovecot-ldap dovecot-sieve dovecot-managesieved dovecot-pop3d \
fetchmail libdbi-perl libdbd-pg-perl libdbd-mysql-perl liblockfile-simple-perl \
clamav clamav-daemon libclamunrar \
python3-pip python3-setuptools python3-wheel \
rsyslog dnsutils curl unbound jq rsync \
inotify-tools \
&& rm -rf /var/spool/postfix \
&& ln -s /var/mail/postfix/spool /var/spool/postfix \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/debconf/*-old \
&& pip3 install watchdog
EXPOSE 25 143 465 587 993 4190 11334
COPY rootfs /
RUN chmod +x /usr/local/bin/* /services/*/run /services/.s6-svscan/finish
CMD ["run.sh"]