kolla/docker/fluentd/Dockerfile.j2
Eduardo Gonzalez 3a0979c90a Revert "Fluentd: add fluent-plugin-concat:1.0.0 gem"
This reverts commit 83baad304d.

The plugin is not used in any deployment tool. Was introduced to make multiline but finally standard multiline was used.
This change removes an unused plugin.

Change-Id: Ie38a876d56846ebdec02fa05707e9d22a02788e6
2017-10-16 09:10:08 +01:00

76 lines
2.7 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block fluentd_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{{ macros.configure_user(name='fluentd', groups='mysql') }}
# TODO:remove hostname package as it should be installed by the
# fluentd dependencies.
# hostname package is installed by default on CentOS/RHEL but not on
# oraclelinux.
{% set fluentd_packages = [
'fluentd',
'gcc-c++',
'hostname',
'make',
'ruby-devel'
] %}
{% elif base_distro in ['debian', 'ubuntu'] %}
{{ macros.configure_user(name='td-agent', groups='mysql') }}
{% set fluentd_packages = [
'g++',
'make',
'td-agent'
] %}
{% endif %}
{{ macros.install_packages(fluentd_packages | customizable("packages")) }}
{% block fluentd_plugins_install %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
COPY rpm_fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN ulimit -n 65536 \
&& gem install --minimal-deps activesupport:4.2.9 public_suffix:2.0.5 fluent-plugin-parser fluent-plugin-kubernetes_metadata_filter fluent-plugin-elasticsearch fluent-plugin-grep fluent-plugin-grok-parser:0.3.1 fluent-plugin-rewrite-tag-filter fluent-plugin-secure-forward \
&& chmod -R 440 /etc/sudoers.d/kolla_fluentd_sudoers \
&& chmod 755 /usr/local/bin/kolla_extend_start \
&& mkdir -p /var/run/fluentd \
&& chown -R fluentd: /etc/fluentd /var/run/fluentd
{% elif base_distro in ['debian', 'ubuntu'] %}
# NOTE: We use fluentd version is v12.0 so fluent-plugin-grok-parse version should < 1.0.0.
# https://github.com/fluent/fluent-plugin-grok-parser
RUN ulimit -n 65536 \
&& sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent \
&& td-agent-gem install fluent-plugin-parser fluent-plugin-kubernetes_metadata_filter fluent-plugin-elasticsearch fluent-plugin-grep fluent-plugin-grok-parser:0.3.1 fluent-plugin-rewrite-tag-filter fluent-plugin-secure-forward \
&& rm -f /etc/td-agent/td-agent.conf
COPY fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \
&& chmod 755 /usr/local/bin/kolla_extend_start \
&& chown -R td-agent: /etc/td-agent
{% endif %}
{% endblock %}
{% block fluentd_footer %}{% endblock %}
{% block footer %}{% endblock %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
USER fluentd
{% elif base_distro in ['debian', 'ubuntu'] %}
USER td-agent
{% endif %}