ab679adcbf
Many images have 'if x86_64 then amd64 elif aarch64 then arm64' check to comply with Debian like architecture names in several projects. This patch creates 'debian_arch' variable which can be used in all Docker files (similar to 'base_arch' one). All required images got converted to use it. Change-Id: I9c5e6f13d6c9b24fe323408512bd5aef290111ad
61 lines
2.1 KiB
Django/Jinja
61 lines
2.1 KiB
Django/Jinja
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
|
|
|
{% block logstash_header %}{% endblock %}
|
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
{{ macros.configure_user(name='logstash', shell='/bin/bash', homedir='/usr/share/logstash') }}
|
|
|
|
{% if base_package_type == 'rpm' %}
|
|
{% set logstash_packages = [
|
|
'java-1.8.0-openjdk-headless'
|
|
] %}
|
|
|
|
ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk/
|
|
|
|
{% elif base_package_type == 'deb' %}
|
|
{% set logstash_packages = [
|
|
'openjdk-8-jre-headless',
|
|
'logrotate'
|
|
] %}
|
|
|
|
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-{{debian_arch}}/
|
|
|
|
{% endif %}
|
|
|
|
{{ macros.install_packages(logstash_packages | customizable("packages")) }}
|
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
|
|
|
# FIXME(dszumski): Logstash was added to Kolla for Monasca. Monasca is
|
|
# currently tied to an old messaging version in Kafka (0.9) and doesn't
|
|
# work with Logstash 5.x or above. When Monasca is updated to use a more
|
|
# recent messaging version this patch should be reverted and the Monasca
|
|
# Logstash configuration files upgraded to use the new format.
|
|
{% if base_package_type == 'rpm' %}
|
|
|
|
ENV logstash_rpm_url=https://download.elastic.co/logstash/logstash/packages/centos/logstash-2.4.1.noarch.rpm
|
|
ENV logstash_rpm_sha1sum=68c5e78c3d941f06f77d638c0756b6aea715bec5
|
|
RUN curl -sSL -o /tmp/logstash.rpm ${logstash_rpm_url} \
|
|
&& echo "${logstash_rpm_sha1sum} /tmp/logstash.rpm" | sha1sum -c \
|
|
&& yum -y install /tmp/logstash.rpm \
|
|
&& rm -f /tmp/logstash.rpm
|
|
|
|
{% elif base_package_type == 'deb' %}
|
|
|
|
ENV logstash_deb_url=https://download.elastic.co/logstash/logstash/packages/debian/logstash-2.4.1_all.deb
|
|
ENV logstash_deb_sha1sum=7ba3b174a3ef48a7d0945d9b5c7f12c5005abb47
|
|
RUN curl -sSL -o /tmp/logstash.deb ${logstash_deb_url} \
|
|
&& echo "${logstash_deb_sha1sum} /tmp/logstash.deb" | sha1sum -c \
|
|
&& apt install /tmp/logstash.deb \
|
|
&& rm -f /tmp/logstash.deb
|
|
|
|
{% endif %}
|
|
|
|
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
|
|
|
{% block logstash_footer %}{% endblock %}
|
|
{% block footer %}{% endblock %}
|
|
|
|
USER logstash
|