Skip to content

Commit e227192

Browse files
committed
non-root postfix and dovecot
1 parent 3e951bf commit e227192

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

dovecot/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
FROM ubuntu:noble
2-
2+
ARG POSTFIX_UID=4005
3+
ARG POSTFIX_GID=4005
4+
ARG DOVECOT_UID=4006
5+
ARG DOVECOT_GID=4006
36
RUN apt-get update && apt-get install -qy dovecot-core dovecot-imapd
7+
RUN useradd -u $POSTFIX_UID -g $POSTFIX_GID -s /bin/false postfix
8+
RUN useradd -u $DOVECOT_UID -g $DOVECOT_GID -s /bin/false dovecot
9+
USER dovecot
410

511
CMD [ "/usr/sbin/dovecot", "-F" ]

postfix/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
FROM ubuntu:noble
22

3-
RUN apt-get update && apt-get install -qy postfix
3+
ARG POSTFIX_UID=4005
4+
ARG POSTFIX_GID=4005
5+
ARG DOVECOT_UID=4006
6+
ARG DOVECOT_GID=4006
7+
RUN apt-get update && apt-get install -qy postfix dovecot-core dovecot-imapd
8+
RUN useradd -u $POSTFIX_UID -g $POSTFIX_GID -s /bin/false postfix
9+
RUN useradd -u $DOVECOT_UID -g $DOVECOT_GID -s /bin/false dovecot
10+
USER postfix
411

512
CMD [ "/usr/sbin/postfix" "start-fg" ]

0 commit comments

Comments
 (0)