kolla-ansible/docker/fluentd/Dockerfile.j2
Serguei Bezverkhi 749679448a Adds Fluentd docker image required for kolla-kube
This PS adds Fluentd docker image to Kolla. Kolla
currently does not use Fluentd for log collection, but this image
is required for Kubernetes centralized logging solution.

Change-Id: I719661d75f5044239a1fd52080d322c77490ecae
Partially_Implements: blueprint kubernetes-images
2016-10-12 13:32:23 -04:00

55 lines
1.6 KiB
Django/Jinja

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