Browse Source

redirected all log files

tags/v1.0.0
Robin Thoni 7 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
 mailman
1
 mailman
2
-ensure there's no log in containers
3
 dmarc
2
 dmarc

+ 5
- 0
dovecot/Dockerfile View File

19
 RUN chown root:Debian-exim /etc/exim4/passwd.client &&\
19
 RUN chown root:Debian-exim /etc/exim4/passwd.client &&\
20
     update-exim4.conf
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
 COPY ./sieve/ /etc/dovecot/sieve/
27
 COPY ./sieve/ /etc/dovecot/sieve/
23
 
28
 
24
 COPY ./run.sh /run.sh
29
 COPY ./run.sh /run.sh

+ 10
- 1
opendkim/Dockerfile View File

9
 RUN rm /etc/opendkim.conf &&\
9
 RUN rm /etc/opendkim.conf &&\
10
     ln -s /etc/opendkim/opendkim.conf /etc/opendkim.conf
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
 COPY ./config /etc/opendkim/
21
 COPY ./config /etc/opendkim/
15
 
22
 
16
 RUN chown -R opendkim:opendkim /etc/opendkim
23
 RUN chown -R opendkim:opendkim /etc/opendkim
17
 
24
 
25
+COPY ./run.sh /run.sh
26
+
18
 VOLUME ["/etc/opendkim/keys"]
27
 VOLUME ["/etc/opendkim/keys"]
19
 
28
 
20
 CMD ["/run.sh"]
29
 CMD ["/run.sh"]

+ 1
- 2
opendkim/run.sh View File

21
 service rsyslog start
21
 service rsyslog start
22
 service opendkim start
22
 service opendkim start
23
 #/usr/sbin/opendkim -f -v -x /etc/opendkim.conf
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
     apt-get install -y postfix postfix-pgsql rsyslog &&\
13
     apt-get install -y postfix postfix-pgsql rsyslog &&\
14
     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
14
     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15
 
15
 
16
-COPY ./run.sh /run.sh
17
-
18
 RUN rm -rf /etc/postfix/*
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
 COPY ./config/ /etc/postfix/
25
 COPY ./config/ /etc/postfix/
21
 
26
 
22
 COPY ./certs/ /etc/ssl/private/
27
 COPY ./certs/ /etc/ssl/private/
23
 
28
 
29
+COPY ./run.sh /run.sh
30
+
24
 EXPOSE 25 587
31
 EXPOSE 25 587
25
 
32
 
26
 CMD ["/run.sh"]
33
 CMD ["/run.sh"]

+ 1
- 3
postfix/run.sh View File

16
 service rsyslog start &&
16
 service rsyslog start &&
17
 service postfix start &&
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
         php5-gd\
13
         php5-gd\
14
         php5-curl\
14
         php5-curl\
15
         php5-imap &&\
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
 COPY ./postfixadmin-3.0/ /var/www/html/
31
 COPY ./postfixadmin-3.0/ /var/www/html/
32
+
28
 RUN chmod -R 777 /var/www/html/templates_c
33
 RUN chmod -R 777 /var/www/html/templates_c
29
 
34
 
30
 COPY run.sh /run.sh
35
 COPY run.sh /run.sh

+ 2
- 0
postgresql/Dockerfile View File

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

Loading…
Cancel
Save