简体   繁体   中英

can't install ElasticSearch image, with java 8

I used the official docker image for els (elasticsearch:6.6.1), and I get the following error, when I run the image:

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

from searching online, there is problem with the JAVA, its using, and JAVA 8 is recommended.

I tried to make dockerfile that takes els:6.6.1 image, and install java8 on it:

FROM elasticsearch:6.6.1
RUN yum install -y  java-1.8.0-openjdk-devel
RUN export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64
RUN export PATH=$PATH:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/bin/

When I run it, I don't see JAVA_HOME env changing to the path I gave, and I still get the above error.

Do you know why?

Set environment variables by using ENV instead of RUN export .

FROM elasticsearch:6.6.1
RUN yum install -y java-1.8.0-openjdk-devel
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64

You can see more explanation by VonC docker ENV vs RUN export .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM