Browse Source

redirected all log files

tags/v1.0.0
Robin Thoni 8 years ago
parent
commit
7586774711
8 changed files with 41 additions and 17 deletions
  1. 0
    1
      TODO
  2. 5
    0
      dovecot/Dockerfile
  3. 10
    1
      opendkim/Dockerfile
  4. 1
    2
      opendkim/run.sh
  5. 9
    2
      postfix/Dockerfile
  6. 1
    3
      postfix/run.sh
  7. 13
    8
      postfixadmin/Dockerfile
  8. 2
    0
      postgresql/Dockerfile

+ 0
- 1
TODO View File

@@ -1,3 +1,2 @@
1 1
 mailman
2
-ensure there's no log in containers
3 2
 dmarc

+ 5
- 0
dovecot/Dockerfile View File

@@ -19,6 +19,11 @@ COPY ./exim4/ /etc/exim4/
19 19
 RUN chown root:Debian-exim /etc/exim4/passwd.client &&\
20 20
     update-exim4.conf
21 21
 
22
+RUN rm -rf /var/log/* &&\
23
+    mkdir -p /var/log/exim4/ &&\
24
+    ln -s /dev/stdout /var/log/exim4/mainlog &&\
25
+    ln -s /dev/stderr /var/log/exim4/paniclog
26
+
22 27
 COPY ./sieve/ /etc/dovecot/sieve/
23 28
 
24 29
 COPY ./run.sh /run.sh

+ 10
- 1
opendkim/Dockerfile View File

@@ -9,12 +9,21 @@ RUN apt-get update &&\
9 9
 RUN rm /etc/opendkim.conf &&\
10 10
     ln -s /etc/opendkim/opendkim.conf /etc/opendkim.conf
11 11
 
12
-COPY ./run.sh /run.sh
12
+RUN rm -rf /var/log/* &&\
13
+    mkfifo /var/log/syslog &&\
14
+    ln -s /dev/null /var/log/mail.log &&\
15
+    ln -s /dev/null /var/log/mail.err &&\
16
+    ln -s /dev/null /var/log/main.info &&\
17
+    ln -s /dev/null /var/log/messages
18
+
19
+RUN sed -e 's/\(\$ModLoad imklog.*\)/#\1/' -i /etc/rsyslog.conf
13 20
 
14 21
 COPY ./config /etc/opendkim/
15 22
 
16 23
 RUN chown -R opendkim:opendkim /etc/opendkim
17 24
 
25
+COPY ./run.sh /run.sh
26
+
18 27
 VOLUME ["/etc/opendkim/keys"]
19 28
 
20 29
 CMD ["/run.sh"]

+ 1
- 2
opendkim/run.sh View File

@@ -21,5 +21,4 @@ rm -f /var/run/opendkim/opendkim.pid
21 21
 service rsyslog start
22 22
 service opendkim start
23 23
 #/usr/sbin/opendkim -f -v -x /etc/opendkim.conf
24
-tail -f /var/log/syslog
25
-
24
+cat /var/log/syslog

+ 9
- 2
postfix/Dockerfile View File

@@ -13,14 +13,21 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update &&\
13 13
     apt-get install -y postfix postfix-pgsql rsyslog &&\
14 14
     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15 15
 
16
-COPY ./run.sh /run.sh
17
-
18 16
 RUN rm -rf /etc/postfix/*
19 17
 
18
+RUN rm -rf /var/log/* &&\
19
+    mkfifo /var/log/mail.info &&\
20
+    ln -s /dev/null /var/log/mail.log &&\
21
+    ln -s /dev/stderr /var/log/mail.err &&\
22
+    ln -s /dev/null /var/log/syslog &&\
23
+    ln -s /dev/null /var/log/messages
24
+
20 25
 COPY ./config/ /etc/postfix/
21 26
 
22 27
 COPY ./certs/ /etc/ssl/private/
23 28
 
29
+COPY ./run.sh /run.sh
30
+
24 31
 EXPOSE 25 587
25 32
 
26 33
 CMD ["/run.sh"]

+ 1
- 3
postfix/run.sh View File

@@ -16,6 +16,4 @@ rm -f /var/run/rsyslogd.pid
16 16
 service rsyslog start &&
17 17
 service postfix start &&
18 18
 
19
-sleep 3 &&
20
-
21
-tail -f /var/log/mail.info
19
+cat /var/log/mail.info

+ 13
- 8
postfixadmin/Dockerfile View File

@@ -13,18 +13,23 @@ RUN apt-get update && apt-get -y install\
13 13
         php5-gd\
14 14
         php5-curl\
15 15
         php5-imap &&\
16
-        apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\
17
-        /usr/sbin/a2enmod rewrite &&\
18
-        rm -rf /var/www/html &&\
19
-        mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
20
-        chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
21
-        ln -sf /dev/stderr /var/log/apache2/error.log &&\
22
-        ln -sf /dev/stdout /var/log/apache2/access.log
16
+        apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
23 17
 
24
-COPY apache2.conf /etc/apache2/apache2.conf
18
+RUN /usr/sbin/a2enmod rewrite &&\
19
+    rm -rf /var/www/html &&\
20
+    mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
21
+    chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
22
+
23
+RUN rm -rf /var/log/* &&\
24
+    mkdir -p /var/log/apache2 &&\
25
+    ln -s /dev/stderr /var/log/apache2/error.log &&\
26
+    ln -s /dev/stdout /var/log/apache2/access.log &&\
27
+    ln -s /dev/stdout /var/log/apache2/other_vhosts_access.log
25 28
 
29
+COPY apache2.conf /etc/apache2/apache2.conf
26 30
 
27 31
 COPY ./postfixadmin-3.0/ /var/www/html/
32
+
28 33
 RUN chmod -R 777 /var/www/html/templates_c
29 34
 
30 35
 COPY run.sh /run.sh

+ 2
- 0
postgresql/Dockerfile View File

@@ -1,3 +1,5 @@
1 1
 FROM postgres:9.6
2 2
 
3
+RUN rm -rf /var/log/*
4
+
3 5
 COPY ./docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d

Loading…
Cancel
Save