diff --git a/build-version-via-dockerfile.sh b/build-version-via-dockerfile.sh new file mode 100755 index 0000000..97b4e4b --- /dev/null +++ b/build-version-via-dockerfile.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -exu + +if [ $# -lt 1 ]; then + echo "$0 [push]" >&2 + exit 1 +fi +container=$1; shift + +name=harbor.k8s.ungleich.ch/ungleich-public/${container} + +push="" +if [ $# -ge 1 ]; then + push=yes +fi + +cd $container +for df in Dockerfile_*; do + version=$(echo $df | cut -d_ -f 2) + tag=${name}:${version} + + docker build -t ${tag} -f ${df} . + + if [ "$push" ]; then + docker push ${tag} + fi +done diff --git a/ungleich-mail/Dockerfile b/ungleich-mail/Dockerfile deleted file mode 100644 index 45d4233..0000000 --- a/ungleich-mail/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM alpine:3.19 - -RUN apk add --update \ - postfix \ - dovecot - -COPY entrypoint.sh / -ENTRYPOINT /entrypoint.sh diff --git a/ungleich-mail/Dockerfile_3.19 b/ungleich-mail/Dockerfile_3.19 new file mode 100644 index 0000000..b97d9c8 --- /dev/null +++ b/ungleich-mail/Dockerfile_3.19 @@ -0,0 +1,10 @@ +FROM alpine:3.19 + +RUN apk add --update \ + postfix \ + dovecot + +# COPY entrypoint.sh / +# ENTRYPOINT /entrypoint.sh + +RUN postconf maillog_file=/dev/stdout diff --git a/ungleich-mail/Dockerfile_3.20 b/ungleich-mail/Dockerfile_3.20 new file mode 100644 index 0000000..76db122 --- /dev/null +++ b/ungleich-mail/Dockerfile_3.20 @@ -0,0 +1,7 @@ +FROM alpine:3.20 + +RUN apk add --update \ + postfix \ + dovecot + +RUN postconf maillog_file=/dev/stdout diff --git a/ungleich-mail/README.org b/ungleich-mail/README.org index 9d1cfad..c3249f9 100644 --- a/ungleich-mail/README.org +++ b/ungleich-mail/README.org @@ -1,6 +1,14 @@ -* Stuff to do +* Usage (as of 2024) +** Intro + - Postfix can be started using "/usr/sbin/postfix start-fg" + - Logging is already configured for stdout +** Next todos +*** Add simple authentication support + - so we can be used as a smarthost +* Stuff to do (before 2024) ** PROGRESS Add smtp support (postfix?) ** PROGRESS Add imap support + - maybe later? ** PROGRESS Define where/how to save mails - /data would be fitting ** PROGRESS Add db support (?) or not? @@ -8,7 +16,8 @@ - restarts are usually fine - requires dovecot in same containerx ** TODO Define deployment requirements (such as SPF/DKIM etc) -** TODO add stdout logging +** DONE add stdout logging +CLOSED: [2024-10-05 Sat 14:37] Logging to stdout is useful when Postfix runs in a container, as it eliminates a syslogd dependency. diff --git a/ungleich-mail/archived_entrypoint.sh b/ungleich-mail/archived_entrypoint.sh new file mode 100644 index 0000000..155fe38 --- /dev/null +++ b/ungleich-mail/archived_entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Just for reference - we inject commands directly via kubernetes +/usr/sbin/postfix start-fg diff --git a/ungleich-mail/entrypoint.sh b/ungleich-mail/entrypoint.sh deleted file mode 100644 index d105c83..0000000 --- a/ungleich-mail/entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -/usr/sbin/postfix start -/usr/sbin/dovecot