docker-elasticsearch-alpine icon indicating copy to clipboard operation
docker-elasticsearch-alpine copied to clipboard

Cannot install core ES plugin because of bad Java JDK path

Open Scoottykun opened this issue 2 years ago • 0 comments

Hello,

I'm trying to add the "analysis-icu" plugin to the "blacktop/elasticsearch:8.1.2" image, below my dockerfile

FROM blacktop/elasticsearch:8.1.2
RUN elasticsearch-plugin install analysis-icu

But on image build i'm having this error :

#5 [2/2] RUN bin/elasticsearch-plugin install analysis-icu
#5 sha256:8e7998a4caf95a423a2aca933e63c0eeb6e0dd54a2e1e9f1e334b7a4416bf8c2
#5 0.318 could not find java in bundled JDK at /usr/share/elasticsearch/jdk/bin/java
#5 ERROR: executor failed running [/bin/sh -c bin/elasticsearch-plugin install analysis-icu]: exit code: 1

After checking within the base image container it seems the right possible paths are :

  • /usr/lib/jvm/java-17-openjdk/bin/java
  • /usr/lib/jvm/default-jvm/bin/java

I tried to force the JAVA_HOME as below, but it doesn't seems to fix my error 👍

FROM blacktop/elasticsearch:8.1.2
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk/bin/java
RUN elasticsearch-plugin install analysis-icu

What would be the right way to add an ES plugin to this docker image ?

Thanks in advance for your help !

Scoottykun avatar Jan 06 '23 10:01 Scoottykun