This repository has been archived by the owner on Nov 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
52 lines (47 loc) · 2.31 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
FROM alpine:3.10
LABEL description "PostfixAdmin is a web based interface used to manage mailboxes" \
maintainer="Hardware <[email protected]>"
ARG VERSION=3.2
# https://pgp.mit.edu/pks/lookup?search=0xC6A682EA63C82F1C&fingerprint=on&op=index
# pub 4096R/63C82F1C 2005-10-06 Christian Boltz (www.cboltz.de) <[email protected]>
ARG GPG_SHORTID="0xC6A682EA63C82F1C"
ARG GPG_FINGERPRINT="70CA A060 DE04 2AAE B1B1 5196 C6A6 82EA 63C8 2F1C"
ARG SHA256_HASH="866d4c0ca870b2cac184e5837a4d201af8fcefecef09bc2c887a6e017a00cefe"
RUN echo "@community https://nl.alpinelinux.org/alpine/v3.10/community" >> /etc/apk/repositories \
&& apk -U upgrade \
&& apk add -t build-dependencies \
ca-certificates \
gnupg \
&& apk add \
su-exec \
dovecot \
tini@community \
php7@community \
php7-phar \
php7-fpm@community \
php7-imap@community \
php7-pgsql@community \
php7-mysqli@community \
php7-session@community \
php7-mbstring@community \
&& cd /tmp \
&& PFA_TARBALL="postfixadmin-${VERSION}.tar.gz" \
&& wget -q https://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-${VERSION}/${PFA_TARBALL} \
&& wget -q https://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-${VERSION}/${PFA_TARBALL}.asc \
&& ( \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys ${GPG_SHORTID} || \
gpg --keyserver keyserver.pgp.com --recv-keys ${GPG_SHORTID} || \
gpg --keyserver pgp.mit.edu --recv-keys ${GPG_SHORTID} \
) \
&& CHECKSUM=$(sha256sum ${PFA_TARBALL} | awk '{print $1}') \
&& if [ "${CHECKSUM}" != "${SHA256_HASH}" ]; then echo "ERROR: Checksum does not match!" && exit 1; fi \
&& FINGERPRINT="$(LANG=C gpg --verify ${PFA_TARBALL}.asc ${PFA_TARBALL} 2>&1 | sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \
&& if [ -z "${FINGERPRINT}" ]; then echo "ERROR: Invalid GPG signature!" && exit 1; fi \
&& if [ "${FINGERPRINT}" != "${GPG_FINGERPRINT}" ]; then echo "ERROR: Wrong GPG fingerprint!" && exit 1; fi \
&& mkdir /postfixadmin && tar xzf ${PFA_TARBALL} -C /postfixadmin && mv /postfixadmin/postfixadmin-$VERSION/* /postfixadmin \
&& apk del build-dependencies \
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg /postfixadmin/postfixadmin-$VERSION*
COPY bin /usr/local/bin
RUN chmod +x /usr/local/bin/*
EXPOSE 8888
CMD ["tini", "--", "run.sh"]