diff --git a/docker/logging/rsyslog/Dockerfile.j2 b/docker/logging/rsyslog/Dockerfile.j2 new file mode 100755 index 0000000000..041cc843f4 --- /dev/null +++ b/docker/logging/rsyslog/Dockerfile.j2 @@ -0,0 +1,17 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +{% if base_distro in ['fedora', 'centos', 'oraclelinux'] %} +RUN yum -y install \ + rsyslog \ + && yum clean all +{% elif base_distro in ['ubuntu', 'debian'] %} +RUN apt-get install -y --no-install-recommends \ + rsyslog \ + && apt-get clean +{% endif %} + +COPY config-external.sh /opt/kolla/ +COPY start.sh / + +CMD ["/start.sh"] diff --git a/docker/logging/rsyslog/config-external.sh b/docker/logging/rsyslog/config-external.sh new file mode 100755 index 0000000000..4352a6f08e --- /dev/null +++ b/docker/logging/rsyslog/config-external.sh @@ -0,0 +1,11 @@ +#!/bin/bash +SOURCE="/opt/kolla/rsyslog/rsyslog.conf" +TARGET="/etc/rsyslog.conf" +OWNER="root" + +if [[ -f "$SOURCE" ]]; then + rm $TARGET + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/logging/rsyslog/start.sh b/docker/logging/rsyslog/start.sh new file mode 100755 index 0000000000..e005d7f435 --- /dev/null +++ b/docker/logging/rsyslog/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit + +CMD="/usr/sbin/rsyslogd" +ARGS="-n" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS