Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 1 | FROM debian:bullseye-slim |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 2 | LABEL maintainer "The Infrastructure Company GmbH <info@servercow.de>" |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 3 | |
| 4 | ARG DEBIAN_FRONTEND=noninteractive |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 5 | # renovate: datasource=github-tags depName=dovecot/core versioning=semver-coerced extractVersion=^v(?<version>.*)$ |
| 6 | ARG DOVECOT=2.3.21 |
| 7 | # renovate: datasource=github-releases depName=tianon/gosu versioning=semver-coerced extractVersion=^v(?<version>.*)$ |
| 8 | ARG GOSU_VERSION=1.16 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 9 | ENV LC_ALL C |
| 10 | |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 11 | |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 12 | # Add groups and users before installing Dovecot to not break compatibility |
| 13 | RUN groupadd -g 5000 vmail \ |
| 14 | && groupadd -g 401 dovecot \ |
| 15 | && groupadd -g 402 dovenull \ |
| 16 | && groupadd -g 999 sogo \ |
| 17 | && usermod -a -G sogo nobody \ |
| 18 | && useradd -g vmail -u 5000 vmail -d /var/vmail \ |
| 19 | && useradd -c "Dovecot unprivileged user" -d /dev/null -u 401 -g dovecot -s /bin/false dovecot \ |
| 20 | && useradd -c "Dovecot login user" -d /dev/null -u 402 -g dovenull -s /bin/false dovenull \ |
| 21 | && touch /etc/default/locale \ |
| 22 | && apt-get update \ |
| 23 | && apt-get -y --no-install-recommends install \ |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 24 | build-essential \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 25 | apt-transport-https \ |
| 26 | ca-certificates \ |
| 27 | cpanminus \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 28 | curl \ |
| 29 | dnsutils \ |
| 30 | dirmngr \ |
| 31 | gettext \ |
| 32 | gnupg2 \ |
| 33 | jq \ |
| 34 | libauthen-ntlm-perl \ |
| 35 | libcgi-pm-perl \ |
| 36 | libcrypt-openssl-rsa-perl \ |
| 37 | libcrypt-ssleay-perl \ |
| 38 | libdata-uniqid-perl \ |
| 39 | libdbd-mysql-perl \ |
| 40 | libdbi-perl \ |
| 41 | libdigest-hmac-perl \ |
| 42 | libdist-checkconflicts-perl \ |
| 43 | libencode-imaputf7-perl \ |
| 44 | libfile-copy-recursive-perl \ |
| 45 | libfile-tail-perl \ |
| 46 | libhtml-parser-perl \ |
| 47 | libio-compress-perl \ |
| 48 | libio-socket-inet6-perl \ |
| 49 | libio-socket-ssl-perl \ |
| 50 | libio-tee-perl \ |
| 51 | libipc-run-perl \ |
| 52 | libjson-webtoken-perl \ |
| 53 | liblockfile-simple-perl \ |
| 54 | libmail-imapclient-perl \ |
| 55 | libmodule-implementation-perl \ |
| 56 | libmodule-scandeps-perl \ |
| 57 | libnet-ssleay-perl \ |
| 58 | libpackage-stash-perl \ |
| 59 | libpackage-stash-xs-perl \ |
| 60 | libpar-packer-perl \ |
| 61 | libparse-recdescent-perl \ |
| 62 | libproc-processtable-perl \ |
| 63 | libreadonly-perl \ |
| 64 | libregexp-common-perl \ |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 65 | libssl-dev \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 66 | libsys-meminfo-perl \ |
| 67 | libterm-readkey-perl \ |
| 68 | libtest-deep-perl \ |
| 69 | libtest-fatal-perl \ |
| 70 | libtest-mock-guard-perl \ |
| 71 | libtest-mockobject-perl \ |
| 72 | libtest-nowarnings-perl \ |
| 73 | libtest-pod-perl \ |
| 74 | libtest-requires-perl \ |
| 75 | libtest-simple-perl \ |
| 76 | libtest-warn-perl \ |
| 77 | libtry-tiny-perl \ |
| 78 | libunicode-string-perl \ |
| 79 | liburi-perl \ |
| 80 | libwww-perl \ |
| 81 | lua-sql-mysql \ |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 82 | lua-socket \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 83 | mariadb-client \ |
| 84 | procps \ |
| 85 | python3-pip \ |
| 86 | redis-server \ |
| 87 | supervisor \ |
| 88 | syslog-ng \ |
| 89 | syslog-ng-core \ |
| 90 | syslog-ng-mod-redis \ |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 91 | wget \ |
| 92 | && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ |
| 93 | && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ |
| 94 | && chmod +x /usr/local/bin/gosu \ |
| 95 | && gosu nobody true \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 96 | && apt-key adv --fetch-keys https://repo.dovecot.org/DOVECOT-REPO-GPG \ |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 97 | && echo "deb https://repo.dovecot.org/ce-${DOVECOT}/debian/bullseye bullseye main" > /etc/apt/sources.list.d/dovecot.list \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 98 | && apt-get update \ |
| 99 | && apt-get -y --no-install-recommends install \ |
| 100 | dovecot-lua \ |
| 101 | dovecot-managesieved \ |
| 102 | dovecot-sieve \ |
| 103 | dovecot-lmtpd \ |
| 104 | dovecot-ldap \ |
| 105 | dovecot-mysql \ |
| 106 | dovecot-core \ |
| 107 | dovecot-pop3d \ |
| 108 | dovecot-imapd \ |
| 109 | dovecot-solr \ |
| 110 | && pip3 install mysql-connector-python html2text jinja2 redis \ |
| 111 | && apt-get autoremove --purge -y \ |
| 112 | && apt-get autoclean \ |
| 113 | && rm -rf /var/lib/apt/lists/* \ |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 114 | && rm -rf /tmp/* /var/tmp/* /root/.cache/ |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 115 | # imapsync dependencies |
| 116 | RUN cpan Crypt::OpenSSL::PKCS12 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 117 | |
| 118 | COPY trim_logs.sh /usr/local/bin/trim_logs.sh |
| 119 | COPY clean_q_aged.sh /usr/local/bin/clean_q_aged.sh |
| 120 | COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf |
| 121 | COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf |
| 122 | COPY imapsync /usr/local/bin/imapsync |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 123 | COPY imapsync_runner.pl /usr/local/bin/imapsync_runner.pl |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 124 | COPY report-spam.sieve /usr/lib/dovecot/sieve/report-spam.sieve |
| 125 | COPY report-ham.sieve /usr/lib/dovecot/sieve/report-ham.sieve |
| 126 | COPY rspamd-pipe-ham /usr/lib/dovecot/sieve/rspamd-pipe-ham |
| 127 | COPY rspamd-pipe-spam /usr/lib/dovecot/sieve/rspamd-pipe-spam |
| 128 | COPY sa-rules.sh /usr/local/bin/sa-rules.sh |
| 129 | COPY maildir_gc.sh /usr/local/bin/maildir_gc.sh |
| 130 | COPY docker-entrypoint.sh / |
| 131 | COPY supervisord.conf /etc/supervisor/supervisord.conf |
| 132 | COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh |
| 133 | COPY quarantine_notify.py /usr/local/bin/quarantine_notify.py |
| 134 | COPY quota_notify.py /usr/local/bin/quota_notify.py |
| 135 | COPY repl_health.sh /usr/local/bin/repl_health.sh |
| 136 | |
| 137 | ENTRYPOINT ["/docker-entrypoint.sh"] |
| 138 | CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf |