harbor/Deploy/log/Dockerfile

27 lines
1.0 KiB
Docker
Raw Normal View History

2016-02-01 12:59:10 +01:00
FROM library/ubuntu:14.04
2016-02-24 03:30:13 +01:00
# run logrotate hourly, disable imklog model, provides TCP/UDP syslog reception
RUN mv /etc/cron.daily/logrotate /etc/cron.hourly/ \
&& sed 's/$ModLoad imklog/#$ModLoad imklog/' -i /etc/rsyslog.conf \
&& sed 's/$KLogPermitNonKernelFacility on/#$KLogPermitNonKernelFacility on/' -i /etc/rsyslog.conf \
&& sed 's/#$ModLoad imudp/$ModLoad imudp/' -i /etc/rsyslog.conf \
&& sed 's/#$UDPServerRun 514/$UDPServerRun 514/' -i /etc/rsyslog.conf \
&& sed 's/#$ModLoad imtcp/$ModLoad imtcp/' -i /etc/rsyslog.conf \
&& sed 's/#$InputTCPServerRun 514/$InputTCPServerRun 514/' -i /etc/rsyslog.conf \
2016-02-29 03:14:01 +01:00
&& sed 's/$PrivDropToUser syslog/#$PrivDropToUser syslog/' -i /etc/rsyslog.conf \
&& sed 's/$PrivDropToGroup syslog/#$PrivDropToGroup syslog/' -i /etc/rsyslog.conf \
2016-02-24 03:30:13 +01:00
&& rm /etc/rsyslog.d/*
2016-02-01 12:59:10 +01:00
# logrotate configuration file for docker
ADD logrotate_docker.conf /etc/logrotate.d/
# rsyslog configuration file for docker
ADD rsyslog_docker.conf /etc/rsyslog.d/
VOLUME /var/log/docker/
EXPOSE 514
2016-02-26 11:37:26 +01:00
CMD cron && rsyslogd -n
2016-02-24 03:30:13 +01:00