1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-22 18:47:23 +01:00

working dockerization

This commit is contained in:
Christian Ertler
2015-02-22 11:36:10 +01:00
parent cf4b05c0a5
commit dfe5d2781d
23 changed files with 299 additions and 95 deletions

View File

@@ -19,8 +19,13 @@ FROM phusion/baseimage:0.9.16
# Dockerfile metadata.
MAINTAINER Joshua Tauberer (http://razor.occams.info)
EXPOSE 25 53/udp 53/tcp 80 443 587 993
VOLUME /data
EXPOSE 25 53/udp 53/tcp 80 443 587 993 4190
VOLUME /home/user-data
CMD ["/sbin/my_init"]
# Create the user-data user, so the start script doesn't have to.
RUN useradd -m user-data
# Docker has a beautiful way to cache images after each step. The next few
# steps of installing system packages are very intensive, so we take care
@@ -32,23 +37,17 @@ VOLUME /data
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
# We want to use Ubuntu's stock rsyslog rather than syslog-ng
# that the base image provides.
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y rsyslog
RUN rm -rf /etc/service/syslog-ng
# Install packages needed by Mail-in-a-Box.
ADD containers/docker/apt_package_list.txt /tmp/mailinabox_apt_package_list.txt
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y $(cat /tmp/mailinabox_apt_package_list.txt)
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y rsyslog
RUN rm -f /tmp/mailinabox_apt_package_list.txt
RUN apt-get clean
# Create the user-data user, so the start script doesn't have to.
RUN useradd -m user-data
# Now add Mail-in-a-Box to the system.
ADD . /usr/local/mailinabox
# We can't know things like the IP address where the container will eventually
# be deployed until the container is started. We also don't want to create any
# private keys during the creation of the image --- that should wait until the
# container is started too. So our whole setup process is deferred until the
# container is started.
RUN mkdir -p /etc/my_init.d
RUN ln -s /usr/local/mailinabox/containers/docker/init.sh /etc/my_init.d/20-mailinabox.sh
# Cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*