2

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?

1
  • 1
    Try ENV JAVA_HOME /usr/lib/xxx. Commented Mar 7, 2019 at 1:12

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.