From 3f1fb67314db002ded45d4f4b13c9a17930c59d8 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 24 Feb 2020 10:05:55 +0100 Subject: [PATCH] postfix: use my pkg instead of internet one --- pkg/postfix/Dockerfile | 11 ++++++++--- pkg/postfix/docker-entrypoint.sh | 14 ++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pkg/postfix/Dockerfile b/pkg/postfix/Dockerfile index bb9653f..a0bb594 100644 --- a/pkg/postfix/Dockerfile +++ b/pkg/postfix/Dockerfile @@ -1,10 +1,15 @@ -FROM alpine:3.7 +FROM alpine MAINTAINER Pierre-Olivier Mercier -RUN apk add --no-cache postfix +RUN apk add --no-cache bash postfix EXPOSE 25 -CMD ["/usr/sbin/postfix", "-d"] +ENV POSTFIX_maillog_file=/dev/stdout + +COPY docker-entrypoint.sh /docker-entrypoint.sh + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["/usr/sbin/postfix", "start-fg"] LABEL org.mobyproject.config='{"binds": ["/etc/resolv.conf:/etc/resolv.conf"], "capabilities": ["CAP_NET_BIND_SERVICE"]}' diff --git a/pkg/postfix/docker-entrypoint.sh b/pkg/postfix/docker-entrypoint.sh index 7db45e9..36b58a6 100755 --- a/pkg/postfix/docker-entrypoint.sh +++ b/pkg/postfix/docker-entrypoint.sh @@ -1,13 +1,7 @@ -#!/bin/sh +#!/bin/bash -set -e - -if [ `which unbound-$1 2>/dev/null` ]; then - set -- unbound-"$@" -elif [ ! `which $1 2>/dev/null` ]; then - set -- unbound -dv "$@" -fi - -unbound-anchor +# POSTFIX_var env -> postconf -e var=$POSTFIX_var +for e in ${!POSTFIX_*} ; do postconf -e "${e:8}=${!e}" ; done +chown -R postfix:postfix /var/lib/postfix /var/mail /var/spool/postfix exec "$@"