mirror of
https://github.com/bokysan/docker-postfix.git
synced 2024-09-20 23:06:13 +08:00
a6d10e6a13
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.
29 lines
783 B
Bash
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
|