Customizations for heka

This patchset contains customization of Dockerfile for
heka container.

Change-Id: I86a76fda182c745ae33c75a83113f471ea220a0c
Partially-implements: blueprint third-party-plugin-support
This commit is contained in:
Josh Lothian 2016-07-26 13:59:16 -04:00
parent 08c7cc7b2d
commit 348dc0fd13

View File

@ -1,22 +1,23 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% import "macros.j2" as macros with context %}
RUN yum -y install \
https://github.com/mozilla-services/heka/releases/download/v0.10.0/heka-0_10_0-linux-amd64.rpm \
&& yum clean all \
&& useradd --user-group heka \
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% set heka_packages = [
'https://github.com/mozilla-services/heka/releases/download/v0.10.0/heka-0_10_0-linux-amd64.rpm'
] %}
RUN useradd --user-group heka \
&& mkdir /etc/heka
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN curl --location https://github.com/mozilla-services/heka/releases/download/v0.10.0/heka_0.10.0_amd64.deb -o heka_0.10.0_amd64.deb \
&& dpkg -i heka_0.10.0_amd64.deb \
&& rm -f heka_0.10.0_amd64.deb
{% set heka_packages = [
'https://github.com/mozilla-services/heka/releases/download/v0.10.0/heka_0.10.0_amd64.deb'
] %}
{% endif %}
RUN {{ macros.install_packages(heka_packages | customizable("packages")) }}
COPY plugins/modules /usr/share/heka/lua_modules/
COPY plugins/decoders /usr/share/heka/lua_decoders/
COPY plugins/encoders /usr/share/heka/lua_encoders/
@ -29,6 +30,8 @@ RUN usermod -a -G kolla heka \
&& chmod 755 /usr/local/bin/kolla_extend_start \
&& chown -R heka: /usr/share/heka /etc/heka
{% block heka_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER heka