First try of gentoo version

This commit is contained in:
2015-08-26 17:06:00 +02:00
parent 7e47e457ac
commit 4c241564f0
5 changed files with 63 additions and 50 deletions

View File

@@ -1,19 +1,46 @@
FROM ubuntu:14.10
FROM gentoo-amd64-paludis:latest
MAINTAINER Julian Ospald "hasufell@posteo.de"
ENV DEBIAN_FRONTEND noninteractive
RUN locale-gen en_GB en_GB.UTF-8 && dpkg-reconfigure locales
# check these with "cave show <package-name>"
RUN echo -e "*/* acl bash-completion ipv6 kmod openrc pcre readline unicode\
zlib pam ssl sasl bzip2 urandom crypt tcpd\
-acpi -cairo -consolekit -cups -dbus -dri -gnome -gnutls -gtk -ogg -opengl\
-pdf -policykit -qt3support -qt5 -qt4 -sdl -sound -systemd -truetype -vim\
-vim-syntax -wayland -X\
\n\
\nnet-mail/dovecot cydir imapc maildir mbox mdbox pam pop3c sieve sqlite\
\n\
\nmail-mta/postfix dovecot-sasl mbox sasl" \
>> /etc/paludis/use.conf
# Prerequisites
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
apt-get update && apt-get install -y \
ssl-cert \
postfix \
dovecot-imapd && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# update world with our USE flags
RUN chgrp paludisbuild /dev/tty && cave resolve -c world -x
# install nano
RUN apt-get update && apt-get install -y nano
# install dovecot
RUN chgrp paludisbuild /dev/tty && cave resolve -z net-mail/dovecot mail-mta/postfix -x
# install tools
RUN chgrp paludisbuild /dev/tty && cave resolve -z app-admin/supervisor sys-process/htop -x
# update etc files... hope this doesn't screw up
RUN etc-update --automode -5
# create dovecot certificates
RUN mkdir -p /var/tmp/dovecot-cert
RUN cp /usr/share/doc/dovecot-*/mkcert.sh /var/tmp/dovecot-cert/ ; \
cp /usr/share/doc/dovecot-*/dovecot-openssl.cnf /var/tmp/dovecot-cert/
RUN chmod +x /var/tmp/dovecot-cert/mkcert.sh
WORKDIR /var/tmp/dovecot-cert
RUN ./mkcert.sh
RUN chown root:dovecot /etc/ssl/certs/dovecot.pem ; \
chmod 0644 /etc/ssl/certs/dovecot.pem ; \
chown root:dovecot /etc/ssl/private/dovecot.pem ; \
chmod 0600 /etc/ssl/private/dovecot.pem
WORKDIR /
RUN rm -r /var/tmp/dovecot-cert
# create postfix certificates
RUN openssl req -new -x509 -nodes -out /etc/ssl/certs/postfix.pem -keyout /etc/ssl/private/postfix.key -days 3650 -subj '/CN=www.example.com'
# Postfix configuration
ADD ./config/postfix.main.cf /etc/postfix/main.cf
@@ -28,8 +55,8 @@ COPY ./config/dovecot.master /etc/dovecot/conf.d/10-master.conf
COPY ./config/dovecot.lda /etc/dovecot/conf.d/15-lda.conf
COPY ./config/dovecot.imap /etc/dovecot/conf.d/20-imap.conf
# Uncomment to add verbose logging
# COPY ./config/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
COPY ./config/rsyslog.conf /etc/rsyslog.conf
COPY ./config/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
COPY ./config/supervisord.conf /etc/supervisord.conf
# Nice place for your settings
VOLUME ["/mail_settings"]
@@ -43,9 +70,10 @@ RUN chmod -R 755 /boot.d
# Volume to store email
VOLUME ["/vmail"]
# Add user vmail that ownes mail
# Add user vmail that owns mail
RUN groupadd -g 5000 vmail
RUN useradd -g vmail -u 5000 vmail -d /vmail -m
EXPOSE 25 143 587
ENTRYPOINT /boot; service postfix start; service dovecot start; rsyslogd -n
ENTRYPOINT /boot; /usr/bin/supervisord -n