Logstash docker image is not getting created for jdk 11 version

Hi Team,
Is logstash supported for jdk 11 ? I'm not able to create logstash docker image due to below error. It fails at

<Step 28/30 : RUN ./bin/logstash-plugin install logstash-input-kafka
---> Running in 5482e305c73f
e[91mUnrecognized VM option 'UseParNewGC'
e[0me[91mError: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
e[0mThe command '/bin/sh -c ./bin/logstash-plugin install logstash-input-kafka' returned a non-zero code: 1>

However this does not throw an error with jdk 8.
My Dockerfile
FROM docker.apple.com/sample-gbi/gbi-oel7-java11:1.0

Install Java and the "which" command, which is needed by Logstash's shell

scripts.

RUN yum update -y && yum install -y java-1.8.0-openjdk-devel golang tar gzip which git wget &&
yum clean all

Provide a non-root user to run the process.

RUN groupadd --gid 1000 logstash &&
adduser --uid 1000 --gid 1000
--home-dir /usr/share/logstash --no-create-home
logstash

Add Logstash itself.

RUN curl -Lo - https://artifacts.elastic.co/downloads/logstash/logstash-6.3.2.tar.gz |
tar zxf - -C /usr/share &&
mv /usr/share/logstash-6.3.2 /usr/share/logstash &&
chown --recursive logstash:logstash /usr/share/logstash/ &&
chown -R logstash:root /usr/share/logstash &&
chmod -R g=u /usr/share/logstash &&
find /usr/share/logstash -type d -exec chmod g+s {} ; &&
ln -s /usr/share/logstash /opt/logstash

WORKDIR /usr/share/logstash

ADD src/config/env2yaml.go /usr/share/logstash

RUN wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz

RUN tar -xzf go1.10.3.linux-amd64.tar.gz

RUN mv go /usr/local

ENV GOROOT=/usr/local/go

ENV GOPATH=$HOME/usr/share/logstash

ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH

RUN go get gopkg.in/yaml.v2

RUN go build env2yaml.go

RUN mv env2yaml /usr/local/bin/
RUN chmod 0755 /usr/local/bin/env2yaml

ENV ELASTIC_CONTAINER true
ENV PATH=/usr/share/logstash/bin:$PATH

Provide a minimal configuration, so that simple invocations will provide

a good experience.

ADD src/config/pipelines.yml config/pipelines.yml
ADD src/config/logstash-oss.yml config/logstash.yml
ADD src/config/log4j2.properties config/
ADD src/config/default.conf pipeline/logstash.conf
#RUN chown --recursive logstash:root config/ pipeline/
#RUN chown logstash:root /usr/local/bin/env2yaml
#RUN chmod --recursive 755 config/ pipeline/

Ensure Logstash gets a UTF-8 locale by default.

ENV LANG='en_US.UTF-8' LC_ALL='en_US.UTF-8'

Place the startup wrapper script.

ADD src/config/docker-entrypoint /usr/local/bin/
RUN chmod 0755 /usr/local/bin/docker-entrypoint

#USER logstash

EXPOSE 9600 5044

LABEL org.label-schema.schema-version="1.0"
org.label-schema.vendor="Elastic"
org.label-schema.name="logstash"
org.label-schema.version="6.3.2"
org.label-schema.url="https://www.elastic.co/products/logstash"
org.label-schema.vcs-url="https://github.com/elastic/logstash-docker"

RUN ./bin/logstash-plugin install logstash-input-kafka
RUN ./bin/logstash-plugin install logstash-output-kafka

CMD ["/usr/local/bin/docker-entrypoint"]

solved, java version is supported for logstash version => 6.7.0

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.