From 071a6adca8b91e54988cc9aa73d51b78cee920e3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 5 Oct 2024 14:44:42 +0900 Subject: [PATCH] ungleich-mail: add alpine 3.20 version --- build-version-via-dockerfile.sh | 28 ++++++++++++++++++++++++++++ ungleich-mail/Dockerfile | 8 -------- ungleich-mail/Dockerfile_3.19 | 10 ++++++++++ ungleich-mail/Dockerfile_3.20 | 7 +++++++ ungleich-mail/README.org | 13 +++++++++++-- ungleich-mail/archived_entrypoint.sh | 4 ++++ ungleich-mail/entrypoint.sh | 4 ---- 7 files changed, 60 insertions(+), 14 deletions(-) create mode 100755 build-version-via-dockerfile.sh delete mode 100644 ungleich-mail/Dockerfile create mode 100644 ungleich-mail/Dockerfile_3.19 create mode 100644 ungleich-mail/Dockerfile_3.20 create mode 100644 ungleich-mail/archived_entrypoint.sh delete mode 100644 ungleich-mail/entrypoint.sh 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