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 %} {{ macros.configure_user(name='td-agent', groups='mysql') }} {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} {% set fluentd_packages = [ 'gcc-c++', 'make', 'td-agent' ] %} {% elif base_distro in ['debian', 'ubuntu'] %} {% set fluentd_packages = [ 'g++', 'make', 'td-agent' ] %} {% endif %} {{ macros.install_packages(fluentd_packages | customizable("packages")) }} # 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 \ && 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 {% block fluentd_footer %}{% endblock %} {% block footer %}{% endblock %} USER td-agent