Logstash v7.10.0: could not find java; set JAVA_HOME or ensure java is in PATH
Summary
Attempting to run the Docker image build from this Dockerfile fails with the error: could not find java; set JAVA_HOME or ensure java is in PATH
Steps to reproduce
- Clone this repository
- Download the 3 dependencies from the download.json file 2a. I had trouble pulling the ubi8, so I downloaded the full tar file and loaded/tagged manually into my docker env: docker load --input ubi8-8.3.tar docker image tag <image_id> ubi/8:8.3 2b. Update the dockerfile to build off the locally loaded ubi8 image: ARG BASE_REGISTRY=ubi ARG BASE_IMAGE=8 ARG BASE_TAG=8.3
- Build the Docker image: docker image build -t logstash .
- Run the container: docker container run -p 5044:5044 logstash
What is the current bug behavior?
danbitter@Dans-MacBook-Pro logstash % docker container run -p 5044:5044 logstash
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
could not find java; set JAVA_HOME or ensure java is in PATH
What is the expected correct behavior?
logstash-7.10.0.txt danbitter@Dans-MacBook-Pro logstash % docker container run -p 5044:5044 logstash /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) Using system java: /usr/bin/java OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. [ ... various add'l logging output ... ] [2020-11-27T21:10:05,341][INFO ][org.logstash.beats.Server][main][77172c51f480d8d575152fa6c56dfb5a77751d54372add164ca8139422267cae] Starting server on port: 5044 [2020-11-27T21:10:05,653][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
logstash-7.10.0.txt contains the terminal output from building/running the image as described above in "Steps to Reproduce"
logstash-7.10.0-java.txt contains the same information, but with the Dockerfile modified to re-include java-11-openjdk-devel
in the `RUN yum update -y && yum install -y ...` line
Possible fixes
- Restore
java-11-openjdk-devel
to the Dockerfile, line 38 at commid id 7ab6b2b2 - Or, clarify the steps needed to run without
java-11-openjdk-devel
Defintion of Done
-
Bug has been identified and corrected within the container
/cc @ironbank-notifications/bug