108 lines
2.6 KiB
Docker
108 lines
2.6 KiB
Docker
FROM docker.io/alpine:3.17 as builder
|
|
|
|
RUN apk --no-cache add \
|
|
rpcgen \
|
|
g++ \
|
|
make \
|
|
openssl \
|
|
openssl-dev \
|
|
lua5.1-dev \
|
|
libsodium-dev \
|
|
linux-pam-dev \
|
|
zlib-dev \
|
|
bzip2-dev \
|
|
xz-dev \
|
|
lz4-dev \
|
|
icu-dev \
|
|
inotify-tools-dev
|
|
|
|
ENV SHA256_SUM_DOVECOT=caa832eb968148abdf35ee9d0f534b779fa732c0ce4a913d9ab8c3469b218552
|
|
ENV DOVECOT_FILENAME=dovecot-2.3.20.tar.gz
|
|
RUN wget https://www.dovecot.org/releases/2.3/$DOVECOT_FILENAME
|
|
RUN echo "$SHA256_SUM_DOVECOT $DOVECOT_FILENAME" | sha256sum -c - || exit 1
|
|
RUN mkdir /tmp/dovecot
|
|
RUN tar xzf $DOVECOT_FILENAME -C /tmp/dovecot --strip 1
|
|
|
|
ENV SHA256_SUM_PIGEONHOLE=ae32bd4870ea2c1328ae09ba206e9ec12128046d6afca52fbbc9ef7f75617c98
|
|
ENV PIGEONHOLE_FILENAME=dovecot-2.3-pigeonhole-0.5.20.tar.gz
|
|
RUN wget https://pigeonhole.dovecot.org/releases/2.3/$PIGEONHOLE_FILENAME
|
|
RUN echo "$SHA256_SUM_PIGEONHOLE $PIGEONHOLE_FILENAME" | sha256sum -c - || exit 1
|
|
RUN mkdir /tmp/pigeonhole
|
|
RUN tar xzf $PIGEONHOLE_FILENAME -C /tmp/pigeonhole --strip 1
|
|
|
|
RUN cd /tmp/dovecot && \
|
|
./configure --prefix '' \
|
|
--with-notify=inotify \
|
|
--with-lua \
|
|
--with-zlib \
|
|
--with-bzlib \
|
|
--with-pam \
|
|
--with-ssl=openssl \
|
|
--with-sodium \
|
|
--without-sql \
|
|
--with-lzma \
|
|
--with-lz4 \
|
|
--with-icu \
|
|
--without-shadow \
|
|
--with-ssldir=/etc/ssl/mail \
|
|
--with-rundir=/run/dovecot \
|
|
--disable-static && \
|
|
make && \
|
|
make install
|
|
|
|
RUN cd /tmp/pigeonhole && \
|
|
./configure --prefix '' \
|
|
--with-dovecot=/lib/dovecot \
|
|
--disable-static && \
|
|
make && make install
|
|
|
|
FROM docker.io/thallian/confd-env:3.17-3.1.3.0
|
|
|
|
COPY --from=builder /lib/dovecot/ /lib/dovecot/
|
|
COPY --from=builder /libexec/dovecot/ /libexec/dovecot/
|
|
COPY --from=builder /bin/doveadm /bin/doveadm
|
|
COPY --from=builder /bin/doveconf /bin/doveconf
|
|
COPY --from=builder /bin/dsync /bin/dsync
|
|
COPY --from=builder /sbin/dovecot /sbin/dovecot
|
|
COPY --from=builder /bin/sieve* /bin/
|
|
|
|
RUN apk --no-cache add \
|
|
libsodium \
|
|
libbz2 \
|
|
zlib \
|
|
xz-libs \
|
|
lz4-libs \
|
|
lz4 \
|
|
linux-pam \
|
|
openssl \
|
|
ssmtp \
|
|
ca-certificates \
|
|
lua5.1-libs \
|
|
lua5.1-rapidjson \
|
|
curl \
|
|
inotify-tools \
|
|
libssl3
|
|
|
|
RUN addgroup -g 150 dovecot
|
|
RUN adduser -u 140 -h /dev/null -H -s /sbin/nologin -D -G dovecot dovecot
|
|
|
|
RUN addgroup -g 151 dovenull
|
|
RUN adduser -u 141 -h /dev/null -H -s /sbin/nologin -D -G dovenull dovenull
|
|
|
|
RUN addgroup -g 2222 access
|
|
RUN addgroup dovecot access
|
|
|
|
RUN addgroup -g 1111 vmail
|
|
RUN adduser -u 1111 -h /var/lib/vmail -D -G vmail vmail
|
|
|
|
RUN mkdir -p /etc/dovecot/conf.d
|
|
RUN mkdir /var/lib/vmail/sieve-after/
|
|
|
|
RUN chown -R vmail:vmail /var/lib/vmail/sieve-after/
|
|
|
|
EXPOSE 143 4190 6334 7777
|
|
|
|
VOLUME /var/lib/vmail/mail/ /etc/ssl/mail
|
|
|
|
ADD /rootfs /
|