summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/fluentd/Dockerfile.j22
-rw-r--r--docker/macros.j29
2 files changed, 6 insertions, 5 deletions
diff --git a/docker/fluentd/Dockerfile.j2 b/docker/fluentd/Dockerfile.j2
index 6591388e6..1cf3821c3 100644
--- a/docker/fluentd/Dockerfile.j2
+++ b/docker/fluentd/Dockerfile.j2
@@ -82,7 +82,7 @@ RUN tar -xvf /tmp/fluentd-monasca.tar.gz -C /tmp \
&& cd /tmp/fluentd-monasca-* \
&& gem build fluentd-monasca-output.gemspec \
&& gem install fluentd-monasca-output-*.gem \
- && fluent-gem install fluentd-monasca-output-*.gem \
+ && {{ macros.install_fluent_plugins(['fluentd-monasca-output-*.gem'], chain=True) }} \
&& rm -rf /tmp/fluentd*
{% endblock %}
diff --git a/docker/macros.j2 b/docker/macros.j2
index 533a14aa5..5b1c86527 100644
--- a/docker/macros.j2
+++ b/docker/macros.j2
@@ -105,12 +105,13 @@ RUN apt-get update \
&& chmod 755 /usr/bin/kubectl
{% endmacro %}
-{% macro install_fluent_plugins(plugins) -%}
+{% macro install_fluent_plugins(plugins, chain=False) -%}
{% if plugins is defined and plugins|length > 0 -%}
- {% if base_distro in ['centos', 'oraclelinux', 'rhel'] -%}
- RUN ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }}
+ {% if not chain -%} RUN {% endif -%}
+ {%- if base_distro in ['centos', 'oraclelinux', 'rhel'] -%}
+ ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }}
{%- elif base_distro in ['debian', 'ubuntu'] -%}
- RUN ulimit -n 65536 && td-agent-gem install {{ plugins | join(' ') }}
+ ulimit -n 65536 && td-agent-gem install {{ plugins | join(' ') }}
{%- endif %}
{%- endif %}
{%- endmacro %}