FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} MAINTAINER {{ maintainer }} {% block fluentd_header %}{% endblock %} {% import "macros.j2" as macros with context %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} RUN rpm --import https://packages.treasuredata.com/GPG-KEY-td-agent COPY td.repo /etc/yum.repos.d/td.repo {% set fluentd_packages = [ 'td-agent', 'gcc-c++', 'make' ] %} {% elif base_distro in ['ubuntu', 'debian'] %} RUN curl https://packages.treasuredata.com/GPG-KEY-td-agent | apt-key add - \ && echo "deb http://packages.treasuredata.com/2/ubuntu/xenial/ xenial contrib" > /etc/apt/sources.list.d/treasure-data.list \ && apt-get update {% set fluentd_packages = [ 'td-agent', 'make', 'g++' ] %} {% endif %} {{ macros.install_packages(fluentd_packages | customizable("packages")) }} 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-kubernetes_metadata_filter fluent-plugin-elasticsearch fluent-plugin-grep \ && 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 usermod -a -G kolla td-agent \ && chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \ && chmod 755 /usr/local/bin/kolla_extend_start \ && chown -R td-agent: /etc/td-agent \ && mkdir /var/lib/td-agent \ && chown -R td-agent: /var/lib/td-agent {% block fluentd_footer %}{% endblock %} {% block footer %}{% endblock %} {{ include_footer }} USER td-agent