Changed Dockerfile to reduce image size on #109

This commit is contained in:
Thomas VIAL 2016-04-21 18:04:33 +02:00
parent 1539fd6b82
commit 0a0a0cab80
No known key found for this signature in database
GPG key ID: 0394CEE552FAFEFC
2 changed files with 10 additions and 5 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ docker-compose.yml
postfix/ssl/* postfix/ssl/*
letsencrypt/ letsencrypt/
.idea .idea
test/config/empty/

View file

@ -4,9 +4,9 @@ MAINTAINER Thomas VIAL
# Packages # Packages
RUN apt-get update -q --fix-missing RUN apt-get update -q --fix-missing
RUN apt-get -y upgrade RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install vim postfix dovecot-core dovecot-imapd dovecot-pop3d \ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
supervisor gamin amavisd-new spamassassin clamav clamav-daemon libnet-dns-perl libmail-spf-perl \ postfix dovecot-core dovecot-imapd dovecot-pop3d gamin amavisd-new spamassassin razor pyzor \
pyzor razor arj bzip2 cabextract cpio file gzip nomarch p7zip pax unzip zip zoo rsyslog mailutils netcat \ clamav clamav-daemon libnet-dns-perl libmail-spf-perl bzip2 file gzip p7zip unzip zip rsyslog \
opendkim opendkim-tools opendmarc curl fail2ban && apt-get autoclean && rm -rf /var/lib/apt/lists/* opendkim opendkim-tools opendmarc curl fail2ban && apt-get autoclean && rm -rf /var/lib/apt/lists/*
# Configures Dovecot # Configures Dovecot
@ -33,6 +33,11 @@ RUN chmod 644 /etc/clamav/freshclam.conf
RUN (crontab; echo "0 1 * * * /usr/bin/freshclam --quiet") | sort - | uniq - | crontab - RUN (crontab; echo "0 1 * * * /usr/bin/freshclam --quiet") | sort - | uniq - | crontab -
RUN freshclam RUN freshclam
# Enables Pyzor and Razor
USER amavis
RUN razor-admin -create && razor-admin -register && pyzor discover
USER root
# Configure DKIM (opendkim) # Configure DKIM (opendkim)
# DKIM config files # DKIM config files
ADD target/opendkim/opendkim.conf /etc/opendkim.conf ADD target/opendkim/opendkim.conf /etc/opendkim.conf
@ -43,8 +48,7 @@ ADD target/opendmarc/opendmarc.conf /etc/opendmarc.conf
ADD target/opendmarc/default-opendmarc /etc/default/opendmarc ADD target/opendmarc/default-opendmarc /etc/default/opendmarc
# Configures Postfix # Configures Postfix
ADD target/postfix/main.cf /etc/postfix/main.cf ADD target/postfix/main.cf target/postfix/master.cf /etc/postfix/
ADD target/postfix/master.cf /etc/postfix/master.cf
ADD target/bin/generate-ssl-certificate target/bin/generate-dkim-config /usr/local/bin/ ADD target/bin/generate-ssl-certificate target/bin/generate-dkim-config /usr/local/bin/
RUN chmod +x /usr/local/bin/* RUN chmod +x /usr/local/bin/*