docker-postfix/build-scripts/postfix-install.sh
Bojan Čekrlić a6d10e6a13 Upd: Refactor Dockerfile and cache local builds
This refactor simplifies the `Dockerfile` by considerable amount:
new features of mobykit buildkit allow us to cache `apt`/`apk`
folder (so no need to delete `/var/lib/cache`) as well as extract
the build / install logic into separate files, which removes the
need for `&& \` and makes the code *much more* readable.

`build.sh` script has been updated as well to allow caching local
builds when testing, making it much more easier to test.
2022-04-13 09:57:46 +02:00

29 lines
783 B
Bash

#!/bin/sh
set -e
do_alpine() {
apk add --upgrade cyrus-sasl cyrus-sasl-static cyrus-sasl-digestmd5 cyrus-sasl-crammd5 cyrus-sasl-login cyrus-sasl-ntlm
apk add postfix
apk add opendkim
apk add --upgrade ca-certificates tzdata supervisor rsyslog musl musl-utils bash opendkim-utils libcurl jsoncpp lmdb
}
do_ubuntu() {
export DEBIAN_FRONTEND=noninteractive
echo "Europe/Berlin" > /etc/timezone
apt-get update -y -q
apt-get install -y libsasl2-modules
apt-get install -y postfix
apt-get install -y opendkim
apt-get install -y ca-certificates tzdata supervisor rsyslog bash opendkim-tools curl libcurl4 postfix-lmdb netcat
}
if [ -f /etc/alpine-release ]; then
do_alpine
else
do_ubuntu
fi
cp -r /etc/postfix /etc/postfix.template