2016-11-21 09:15:43 +01:00
|
|
|
FROM library/photon:1.0
|
2016-08-23 11:57:12 +02:00
|
|
|
|
|
|
|
# run logrotate hourly, disable imklog model, provides TCP/UDP syslog reception
|
2016-10-26 12:03:31 +02:00
|
|
|
RUN tdnf install -y cronie rsyslog shadow tar gzip \
|
2016-08-23 11:57:12 +02:00
|
|
|
&& mkdir /etc/rsyslog.d/ \
|
|
|
|
&& mkdir /var/spool/rsyslog \
|
|
|
|
&& groupadd syslog \
|
|
|
|
&& useradd -g syslog syslog
|
|
|
|
|
2016-10-19 08:32:00 +02:00
|
|
|
ADD make/common/log/rsyslog.conf /etc/rsyslog.conf
|
2016-08-23 11:57:12 +02:00
|
|
|
|
2016-10-26 12:03:31 +02:00
|
|
|
# rotate logs weekly
|
|
|
|
# notes: file name cannot contain dot, or the script will not run
|
|
|
|
ADD make/common/log/rotate.sh /etc/cron.weekly/rotate
|
2016-08-23 11:57:12 +02:00
|
|
|
|
|
|
|
# rsyslog configuration file for docker
|
2016-10-19 08:32:00 +02:00
|
|
|
ADD make/common/log/rsyslog_docker.conf /etc/rsyslog.d/
|
2016-08-23 11:57:12 +02:00
|
|
|
|
|
|
|
VOLUME /var/log/docker/
|
|
|
|
|
|
|
|
EXPOSE 514
|
|
|
|
|
2016-12-01 15:31:14 +01:00
|
|
|
CMD crond && rm -f /var/run/rsyslogd.pid && rsyslogd -n
|