-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (57 loc) · 1.57 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ARG VERSION=latest
FROM debian:bookworm-slim
ARG VERSION
###
# For a list of pre-defined annotation keys and value types see:
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#
# Note: Additional labels are added by the build workflow.
###
LABEL org.opencontainers.image.authors="Don-Swanson"
LABEL org.opencontainers.image.vendor="Netris Cyber Security"
###
# Upgrade the system
###
RUN apt-get update --quiet --quiet \
&& apt-get upgrade --quiet --quiet
###
# Install everything we need
###
ENV DEPS \
ca-certificates \
gettext-base \
mailutils \
postfix \
procmail \
sasl2-bin
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install --quiet --quiet --yes \
$DEPS \
&& apt-get --quiet --quiet clean \
&& rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
###
# Seup Config Files
###
RUN mkdir /config && \
cp /etc/postfix/main.cf /etc/postfix/main.cf.orig && \
cp /etc/postfix/master.cf /etc/postfix/master.cf.orig && \
mv /etc/postfix/main.cf /config/main.cf && \
mv /etc/postfix/master.cf /config/master.cf && \
touch /config/transport && \
ln -s /config/main.cf /etc/postfix/main.cf && \
ln -s /config/master.cf /etc/postfix/master.cf && \
ln -s /config/transport /etc/postfix/transport
###
# Setup entrypoint
###
USER root
WORKDIR /root
COPY docker-entrypoint.sh ./
RUN ["chmod", "+x", "./docker-entrypoint.sh"]
###
# Prepare to run
###
VOLUME ["/var/log", "/var/spool/postfix", "/config"]
EXPOSE 25/TCP 587/TCP
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["postfix", "-v", "start-fg"]