harbor/make/photon/log/Dockerfile

30 lines
964 B
Docker
Raw Normal View History

FROM photon:2.0
2017-11-06 06:52:23 +01:00
RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\
2017-11-06 06:52:23 +01:00
&& mkdir /var/spool/rsyslog \
&& groupadd -r -g 10000 syslog && useradd --no-log-init -r -g 10000 -u 10000 syslog \
&& tdnf clean all
COPY ./make/photon/log/rsyslog.conf /etc/rsyslog.conf
# rsyslog configuration file for docker
COPY ./make/photon/log/rsyslog_docker.conf /etc/rsyslog.d/
# remove the original "logrotate" in directory "/etc/cron.daily/"
# and copy the customized one to directory "/etc/cron.hourly/"
# to run logrotate hourly
RUN rm /etc/cron.daily/logrotate
COPY ./make/photon/log/logrotate /etc/cron.hourly/
2017-11-08 06:07:27 +01:00
COPY ./make/photon/log/start.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start.sh /etc/rsyslog.d/ && \
chown -R 10000:10000 /etc/rsyslog.conf /etc/rsyslog.d/ /run /var/lib/logrotate/
HEALTHCHECK CMD netstat -ltun|grep 10514
2017-11-08 06:07:27 +01:00
VOLUME /var/log/docker/ /run/ /etc/logrotate.d/
EXPOSE 10514
CMD /usr/local/bin/start.sh