kolla/docker/logstash/Dockerfile.j2
Mark Goddard b32cf27cc9 logstash: pin to 7.9.* for Elasticsearch OSS compatibility
The latest versions of logstash 7.x do not support using the OSS version
of Elasticsearch, and fail to push logs if an OSS version is used. This
prevents Monasca log API from working correctly.

This change fixes the issue by pinning logstash-oss to 7.9.x, the most
recent available package in the repo that still supports Elasticsearch
OSS.

NOTE: logstash 7.11 introduced the breaking change, however 7.10 is
unavailable in the package repos.

Change-Id: I4ec4eb837c98f57964488769ab82ba8213ad582c
Closes-Bug: #1941754
2021-09-30 20:22:34 +01:00

46 lines
1.4 KiB
Django/Jinja

FROM {{ namespace }}/{{ infra_image_prefix }}base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}
{% block logstash_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='logstash', shell='/bin/bash', homedir='/usr/share/logstash') }}
{{ macros.enable_extra_repos(['logstash']) }}
{% if base_package_type == 'rpm' %}
{% set elk_java_package = 'java-11-openjdk-headless' %}
ENV JAVA_HOME /usr/lib/jvm/jre-11-openjdk/
{% elif base_package_type == 'deb' %}
{% set elk_java_package = 'openjdk-11-jre-headless' %}
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-{{debian_arch}}/
{% endif %}
# NOTE(mgoddard): logstash 7.9.x is the last version that supports
# Elasticsearch OSS.
{% if base_package_type == 'rpm' %}
{% set logstash_packages = [
'logstash-oss-7.9.*',
] %}
{% else %}
{% set logstash_packages = [
'logstash-oss',
] %}
{% endif %}
# Post-install script of Logstash fails when trying to install Logstash and
# Java together.
{{ macros.install_packages([elk_java_package]) }}
{{ macros.install_packages(logstash_packages | customizable("packages")) }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block logstash_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER logstash