forked from postfixadmin/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-debian.template
75 lines (67 loc) · 2.35 KB
/
Dockerfile-debian.template
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
FROM php:7.4-%%VARIANT%%
LABEL maintainer="David Goodwin <[email protected]> (@DavidGoodwin)"
# docker-entrypoint.sh dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
gosu \
; \
rm -rf /var/lib/apt/lists/*
# Install required PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client2007e-dev \
libkrb5-dev \
libpq-dev \
libsqlite3-dev \
; \
\
docker-php-ext-configure \
imap --with-imap-ssl --with-kerberos \
; \
\
docker-php-ext-install -j "$(nproc)" \
imap \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
pgsql \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
ARG POSTFIXADMIN_VERSION=3.3.9
ARG POSTFIXADMIN_SHA512=791b05df34a4f2eec01fe6f6b9038a6630cd60c42e1f2e725fe3d033a692b77d2d688858b947c53d1ce48258c7c87a2e3fb31356e553632b88149d5a29bfa70e
ENV POSTFIXADMIN_VERSION $POSTFIXADMIN_VERSION
ENV POSTFIXADMIN_SHA512 $POSTFIXADMIN_SHA512
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
RUN set -eu; sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf; \
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN set -eu; \
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-${POSTFIXADMIN_VERSION}.tar.gz"; \
echo "$POSTFIXADMIN_SHA512 *postfixadmin.tar.gz" | sha512sum -c -; \
# upstream tarball include ./postfixadmin-postfixadmin-${POSTFIXADMIN_VERSION}/
mkdir /usr/src/postfixadmin; \
tar -xf postfixadmin.tar.gz -C /usr/src/postfixadmin --strip-components=1; \
rm postfixadmin.tar.gz; \
# Does not exist in tarball but is required
mkdir -p /usr/src/postfixadmin/templates_c; \
chown -R www-data:www-data /usr/src/postfixadmin
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["%%CMD%%"]