mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 12:15:20 +01:00
719072e0ba
This change mitigate problems with container restarts (stop, start) or automatic restart after host machine restart. Rsyslogd strictly checks existence of its pid file and won't start if such one exists.
24 lines
666 B
Docker
24 lines
666 B
Docker
FROM library/photon:1.0
|
|
|
|
# run logrotate hourly, disable imklog model, provides TCP/UDP syslog reception
|
|
RUN tdnf install -y cronie rsyslog shadow tar gzip \
|
|
&& mkdir /etc/rsyslog.d/ \
|
|
&& mkdir /var/spool/rsyslog \
|
|
&& groupadd syslog \
|
|
&& useradd -g syslog syslog
|
|
|
|
ADD make/common/log/rsyslog.conf /etc/rsyslog.conf
|
|
|
|
# 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
|
|
|
|
# rsyslog configuration file for docker
|
|
ADD make/common/log/rsyslog_docker.conf /etc/rsyslog.d/
|
|
|
|
VOLUME /var/log/docker/
|
|
|
|
EXPOSE 514
|
|
|
|
CMD crond && rm -f /var/run/rsyslogd.pid && rsyslogd -n
|