Skip to content

Commit 8e14cd0

Browse files
committed
PostfixAdmin 4.0.1
1 parent 7c8d83d commit 8e14cd0

File tree

5 files changed

+146
-75
lines changed

5 files changed

+146
-75
lines changed

Dockerfile-alpine.template

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ RUN apk add --no-cache \
1010
RUN set -ex; \
1111
\
1212
apk add --no-cache --virtual .build-deps \
13-
imap-dev \
14-
krb5-dev \
1513
postgresql-dev \
1614
sqlite-dev \
1715
; \
18-
docker-php-ext-configure \
19-
imap --with-imap-ssl --with-kerberos \
20-
; \
2116
docker-php-ext-install -j "$(nproc)" \
22-
imap \
2317
pdo_mysql \
2418
pdo_pgsql \
2519
pdo_sqlite \
@@ -34,14 +28,14 @@ RUN set -ex; \
3428
apk add --no-network --virtual .postfixadmin-phpexts-rundeps $runDeps; \
3529
apk del --no-network .build-deps
3630

37-
ARG POSTFIXADMIN_VERSION=3.3.16
38-
ARG POSTFIXADMIN_SHA512=d1b8074c32f7912c187c2c37c5cca158432cb85fc415d9efe86cf11f70ab035117053cc579306e224cb180e70fa3c84a68335f18d62b43abf591e8105a00847d
31+
ARG POSTFIXADMIN_VERSION=4.0.1
32+
ARG POSTFIXADMIN_SHA512=88be6834257580c7a52dce33ce552e1868a1b28ba639a3378a66278939640073af4f8893fbfac690e2df5e67db0143c5726aab575bf0e4014b39a03d46916831
3933

4034
ENV POSTFIXADMIN_VERSION $POSTFIXADMIN_VERSION
4135
ENV POSTFIXADMIN_SHA512 $POSTFIXADMIN_SHA512
4236

4337
RUN set -eu; \
44-
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-${POSTFIXADMIN_VERSION}.tar.gz"; \
38+
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/v${POSTFIXADMIN_VERSION}.tar.gz"; \
4539
echo "$POSTFIXADMIN_SHA512 *postfixadmin.tar.gz" | sha512sum -c -; \
4640
# upstream tarball include ./postfixadmin-postfixadmin-${POSTFIXADMIN_VERSION}/
4741
mkdir /usr/src/postfixadmin; \
@@ -53,5 +47,21 @@ RUN set -eu; \
5347

5448
COPY docker-entrypoint.sh /usr/local/bin/
5549

50+
WORKDIR /usr/src/postfixadmin
51+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/
52+
53+
# https://github.com/moby/buildkit/issues/4503
54+
# https://github.com/composer/composer/issues/11839
55+
# https://github.com/composer/composer/blob/94fe2945456df51e122a492b8d14ac4b54c1d2ce/src/Composer/Console/Application.php#L217-L218
56+
ENV COMPOSER_ALLOW_SUPERUSER 1
57+
58+
RUN set -eux; \
59+
export COMPOSER_HOME="$(mktemp -d)"; \
60+
# mysqli is expected but we use pdo
61+
composer install --ignore-platform-req=ext-mysqli --no-dev --no-interaction --working-dir /usr/src/postfixadmin; \
62+
# delete composer cache
63+
rm -rf "$COMPOSER_HOME"
64+
65+
WORKDIR /var/www/html
5666
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
5767
CMD ["%%CMD%%"]

Dockerfile-debian.template

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.3-%%VARIANT%%-bookworm
1+
FROM php:8.3-%%VARIANT%%
22
LABEL maintainer="David Goodwin <david@codepoets.co.uk> (@DavidGoodwin)"
33

44
# docker-entrypoint.sh dependencies
@@ -16,40 +16,32 @@ RUN set -ex; \
1616
\
1717
apt-get update; \
1818
apt-get install -y --no-install-recommends \
19-
libc-client2007e-dev \
20-
libkrb5-dev \
21-
libpq-dev \
22-
libsqlite3-dev \
19+
libpq-dev \
20+
libsqlite3-dev \
2321
; \
24-
\
25-
docker-php-ext-configure \
26-
imap --with-imap-ssl --with-kerberos \
27-
; \
28-
\
2922
docker-php-ext-install -j "$(nproc)" \
30-
imap \
3123
pdo_mysql \
3224
pdo_pgsql \
3325
pdo_sqlite \
3426
pgsql \
3527
; \
36-
\
3728
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
3829
apt-mark auto '.*' > /dev/null; \
3930
apt-mark manual $savedAptMark; \
40-
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
31+
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
4132
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4233
| sort -u \
43-
| xargs -r dpkg-query --search \
44-
| cut -d: -f1 \
34+
| xargs -rt dpkg-query --search \
35+
# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file)
36+
| awk 'sub(":$", "", $1) { print $1 }' \
4537
| sort -u \
4638
| xargs -rt apt-mark manual; \
4739
\
4840
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
49-
rm -rf /var/lib/apt/lists/*
41+
apt-get dist-clean
5042

51-
ARG POSTFIXADMIN_VERSION=3.3.16
52-
ARG POSTFIXADMIN_SHA512=d1b8074c32f7912c187c2c37c5cca158432cb85fc415d9efe86cf11f70ab035117053cc579306e224cb180e70fa3c84a68335f18d62b43abf591e8105a00847d
43+
ARG POSTFIXADMIN_VERSION=4.0.1
44+
ARG POSTFIXADMIN_SHA512=88be6834257580c7a52dce33ce552e1868a1b28ba639a3378a66278939640073af4f8893fbfac690e2df5e67db0143c5726aab575bf0e4014b39a03d46916831
5345

5446
ENV POSTFIXADMIN_VERSION $POSTFIXADMIN_VERSION
5547
ENV POSTFIXADMIN_SHA512 $POSTFIXADMIN_SHA512
@@ -59,7 +51,7 @@ RUN set -eu; sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2
5951
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
6052

6153
RUN set -eu; \
62-
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-${POSTFIXADMIN_VERSION}.tar.gz"; \
54+
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/v${POSTFIXADMIN_VERSION}.tar.gz"; \
6355
echo "$POSTFIXADMIN_SHA512 *postfixadmin.tar.gz" | sha512sum -c -; \
6456
# upstream tarball include ./postfixadmin-postfixadmin-${POSTFIXADMIN_VERSION}/
6557
mkdir /usr/src/postfixadmin; \
@@ -71,5 +63,30 @@ RUN set -eu; \
7163

7264
COPY docker-entrypoint.sh /usr/local/bin/
7365

66+
WORKDIR /usr/src/postfixadmin
67+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/
68+
69+
# https://github.com/moby/buildkit/issues/4503
70+
# https://github.com/composer/composer/issues/11839
71+
# https://github.com/composer/composer/blob/94fe2945456df51e122a492b8d14ac4b54c1d2ce/src/Composer/Console/Application.php#L217-L218
72+
ENV COMPOSER_ALLOW_SUPERUSER 1
73+
74+
RUN set -eux; \
75+
composerDeps=" \
76+
unzip \
77+
"; \
78+
apt-get update; \
79+
apt-get install -y --no-install-recommends $composerDeps; \
80+
\
81+
export COMPOSER_HOME="$(mktemp -d)"; \
82+
# mysqli is expected but we use pdo
83+
composer install --ignore-platform-req=ext-mysqli --no-dev --no-interaction --working-dir /usr/src/postfixadmin; \
84+
# delete composer cache
85+
rm -rf "$COMPOSER_HOME"; \
86+
\
87+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $composerDeps; \
88+
apt-get dist-clean
89+
90+
WORKDIR /var/www/html
7491
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
7592
CMD ["%%CMD%%"]

apache/Dockerfile

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.3-apache-bookworm
1+
FROM php:8.3-apache
22
LABEL maintainer="David Goodwin <david@codepoets.co.uk> (@DavidGoodwin)"
33

44
# docker-entrypoint.sh dependencies
@@ -16,40 +16,32 @@ RUN set -ex; \
1616
\
1717
apt-get update; \
1818
apt-get install -y --no-install-recommends \
19-
libc-client2007e-dev \
20-
libkrb5-dev \
21-
libpq-dev \
22-
libsqlite3-dev \
19+
libpq-dev \
20+
libsqlite3-dev \
2321
; \
24-
\
25-
docker-php-ext-configure \
26-
imap --with-imap-ssl --with-kerberos \
27-
; \
28-
\
2922
docker-php-ext-install -j "$(nproc)" \
30-
imap \
3123
pdo_mysql \
3224
pdo_pgsql \
3325
pdo_sqlite \
3426
pgsql \
3527
; \
36-
\
3728
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
3829
apt-mark auto '.*' > /dev/null; \
3930
apt-mark manual $savedAptMark; \
40-
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
31+
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
4132
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
4233
| sort -u \
43-
| xargs -r dpkg-query --search \
44-
| cut -d: -f1 \
34+
| xargs -rt dpkg-query --search \
35+
# https://manpages.debian.org/trixie/dpkg/dpkg-query.1.en.html#S (we ignore diversions and it'll be really unusual for more than one package to provide any given .so file)
36+
| awk 'sub(":$", "", $1) { print $1 }' \
4537
| sort -u \
4638
| xargs -rt apt-mark manual; \
4739
\
4840
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
49-
rm -rf /var/lib/apt/lists/*
41+
apt-get dist-clean
5042

51-
ARG POSTFIXADMIN_VERSION=3.3.16
52-
ARG POSTFIXADMIN_SHA512=d1b8074c32f7912c187c2c37c5cca158432cb85fc415d9efe86cf11f70ab035117053cc579306e224cb180e70fa3c84a68335f18d62b43abf591e8105a00847d
43+
ARG POSTFIXADMIN_VERSION=4.0.1
44+
ARG POSTFIXADMIN_SHA512=88be6834257580c7a52dce33ce552e1868a1b28ba639a3378a66278939640073af4f8893fbfac690e2df5e67db0143c5726aab575bf0e4014b39a03d46916831
5345

5446
ENV POSTFIXADMIN_VERSION $POSTFIXADMIN_VERSION
5547
ENV POSTFIXADMIN_SHA512 $POSTFIXADMIN_SHA512
@@ -59,7 +51,7 @@ RUN set -eu; sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2
5951
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
6052

6153
RUN set -eu; \
62-
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-${POSTFIXADMIN_VERSION}.tar.gz"; \
54+
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/v${POSTFIXADMIN_VERSION}.tar.gz"; \
6355
echo "$POSTFIXADMIN_SHA512 *postfixadmin.tar.gz" | sha512sum -c -; \
6456
# upstream tarball include ./postfixadmin-postfixadmin-${POSTFIXADMIN_VERSION}/
6557
mkdir /usr/src/postfixadmin; \
@@ -71,5 +63,30 @@ RUN set -eu; \
7163

7264
COPY docker-entrypoint.sh /usr/local/bin/
7365

66+
WORKDIR /usr/src/postfixadmin
67+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/
68+
69+
# https://github.com/moby/buildkit/issues/4503
70+
# https://github.com/composer/composer/issues/11839
71+
# https://github.com/composer/composer/blob/94fe2945456df51e122a492b8d14ac4b54c1d2ce/src/Composer/Console/Application.php#L217-L218
72+
ENV COMPOSER_ALLOW_SUPERUSER 1
73+
74+
RUN set -eux; \
75+
composerDeps=" \
76+
unzip \
77+
"; \
78+
apt-get update; \
79+
apt-get install -y --no-install-recommends $composerDeps; \
80+
\
81+
export COMPOSER_HOME="$(mktemp -d)"; \
82+
# mysqli is expected but we use pdo
83+
composer install --ignore-platform-req=ext-mysqli --no-dev --no-interaction --working-dir /usr/src/postfixadmin; \
84+
# delete composer cache
85+
rm -rf "$COMPOSER_HOME"; \
86+
\
87+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $composerDeps; \
88+
apt-get dist-clean
89+
90+
WORKDIR /var/www/html
7491
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
7592
CMD ["apache2-foreground"]

fpm-alpine/Dockerfile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ RUN apk add --no-cache \
1010
RUN set -ex; \
1111
\
1212
apk add --no-cache --virtual .build-deps \
13-
imap-dev \
14-
krb5-dev \
1513
postgresql-dev \
1614
sqlite-dev \
1715
; \
18-
docker-php-ext-configure \
19-
imap --with-imap-ssl --with-kerberos \
20-
; \
2116
docker-php-ext-install -j "$(nproc)" \
22-
imap \
2317
pdo_mysql \
2418
pdo_pgsql \
2519
pdo_sqlite \
@@ -34,14 +28,14 @@ RUN set -ex; \
3428
apk add --no-network --virtual .postfixadmin-phpexts-rundeps $runDeps; \
3529
apk del --no-network .build-deps
3630

37-
ARG POSTFIXADMIN_VERSION=3.3.16
38-
ARG POSTFIXADMIN_SHA512=d1b8074c32f7912c187c2c37c5cca158432cb85fc415d9efe86cf11f70ab035117053cc579306e224cb180e70fa3c84a68335f18d62b43abf591e8105a00847d
31+
ARG POSTFIXADMIN_VERSION=4.0.1
32+
ARG POSTFIXADMIN_SHA512=88be6834257580c7a52dce33ce552e1868a1b28ba639a3378a66278939640073af4f8893fbfac690e2df5e67db0143c5726aab575bf0e4014b39a03d46916831
3933

4034
ENV POSTFIXADMIN_VERSION $POSTFIXADMIN_VERSION
4135
ENV POSTFIXADMIN_SHA512 $POSTFIXADMIN_SHA512
4236

4337
RUN set -eu; \
44-
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-${POSTFIXADMIN_VERSION}.tar.gz"; \
38+
curl -fsSL -o postfixadmin.tar.gz "https://github.com/postfixadmin/postfixadmin/archive/v${POSTFIXADMIN_VERSION}.tar.gz"; \
4539
echo "$POSTFIXADMIN_SHA512 *postfixadmin.tar.gz" | sha512sum -c -; \
4640
# upstream tarball include ./postfixadmin-postfixadmin-${POSTFIXADMIN_VERSION}/
4741
mkdir /usr/src/postfixadmin; \
@@ -53,5 +47,21 @@ RUN set -eu; \
5347

5448
COPY docker-entrypoint.sh /usr/local/bin/
5549

50+
WORKDIR /usr/src/postfixadmin
51+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/
52+
53+
# https://github.com/moby/buildkit/issues/4503
54+
# https://github.com/composer/composer/issues/11839
55+
# https://github.com/composer/composer/blob/94fe2945456df51e122a492b8d14ac4b54c1d2ce/src/Composer/Console/Application.php#L217-L218
56+
ENV COMPOSER_ALLOW_SUPERUSER 1
57+
58+
RUN set -eux; \
59+
export COMPOSER_HOME="$(mktemp -d)"; \
60+
# mysqli is expected but we use pdo
61+
composer install --ignore-platform-req=ext-mysqli --no-dev --no-interaction --working-dir /usr/src/postfixadmin; \
62+
# delete composer cache
63+
rm -rf "$COMPOSER_HOME"
64+
65+
WORKDIR /var/www/html
5666
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
5767
CMD ["php-fpm"]

0 commit comments

Comments
 (0)