diff --git a/build.sh b/build.sh index 2137e51..5b0c704 100755 --- a/build.sh +++ b/build.sh @@ -2,12 +2,25 @@ TAG="1.5-$(date +%Y%m%d)" -find . -name Dockerfile | while read i; do - dir=$(dirname $i) - pushd ${dir} >/dev/null - image="genunix/mailu-$(basename $dir):${TAG}" +build() { + image=$1 echo "[INFO] Building ${image}" docker build -t ${image} . docker push ${image} +} + +if [ -z "$1" ]; then + find . -name Dockerfile | while read i; do + dir=$(dirname $i) + pushd ${dir} >/dev/null + image="genunix/mailu-$(basename $dir):${TAG}" + build ${image} + popd >/dev/null + done +else + dir=$(basename $1) + image="genunix/mailu-$(basename $dir):${TAG}" + pushd "$1" >/dev/null + build "$image" popd >/dev/null -done +fi diff --git a/core/admin/Dockerfile b/core/admin/Dockerfile index cfc8ac8..6e96f73 100644 --- a/core/admin/Dockerfile +++ b/core/admin/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app COPY requirements-prod.txt requirements.txt RUN apk add --no-cache openssl \ - && apk add --no-cache --virtual build-dep openssl-dev libffi-dev python-dev build-base \ + && apk add --no-cache --virtual build-dep openssl-dev libffi-dev python3-dev build-base \ && pip install -r requirements.txt \ && apk del build-dep diff --git a/core/dovecot/Dockerfile b/core/dovecot/Dockerfile index 843171a..03eb282 100644 --- a/core/dovecot/Dockerfile +++ b/core/dovecot/Dockerfile @@ -2,8 +2,8 @@ FROM alpine:3.13 RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ && apk add --no-cache \ - dovecot dovecot-sqlite dovecot-pigeonhole-plugin dovecot-pigeonhole-plugin-extdata \ - rspamd-client@testing python py-jinja2 + dovecot dovecot-sqlite dovecot-pigeonhole-plugin \ + rspamd-client python3 py3-jinja2 COPY conf /conf COPY sieve /var/lib/dovecot diff --git a/core/postfix/start.py b/core/postfix/start.py index f6068ad..2402362 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -5,7 +5,7 @@ import os import socket import glob import shutil - + convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ)) # Actual startup script @@ -33,6 +33,6 @@ convert("/conf/rsyslog.conf", "/etc/rsyslog.conf") # Run postfix if os.path.exists("/var/run/rsyslogd.pid"): os.remove("/var/run/rsyslogd.pid") -os.system("/usr/lib/postfix/post-install meta_directory=/etc/postfix create-missing") -os.system("/usr/lib/postfix/master &") +os.system("/usr/libexec/postfix/post-install meta_directory=/etc/postfix create-missing") +os.system("/usr/sbin/postfix start") os.execv("/usr/sbin/rsyslogd", ["rsyslogd", "-n"])