Sonarqube 7.8 Docker Image change jdk version

I am upgrading my Sonarqube server from 6.7 to 7.8-community since the latest version can run on openjdk 11. The docker image Sonarqube has hosted is running on openjdk 8. I am trying to make the image run on a custom openjdk 11 version java-11-openjdk-11.0.3.7-0.0.1.el7_6.x86_64.

FROM sonarqube:7.8-community

COPY plugins /opt/sonarqube/extensions/plugins
COPY openjdk-11.0.3.tar.gz .

USER root

RUN \
tar -xvzf openjdk-11.0.3.tar.gz -C /usr/local && \ 
rm -rf openjdk-11.0.3.tar.gz 

ENV JAVA_HOME /usr/local/java-11-openjdk-11

The docker image fails to start with the error below.

2019.06.21 18:20:46 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.06.21 18:20:46 INFO  app[][o.e.p.PluginsService] no modules loaded
2019.06.21 18:20:46 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2019.06.21 18:20:48 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.06.21 18:20:48 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.06.21 18:20:48 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Is there a better way of switching the java version?

Also how do we restart Sonarqube server from inside the docker container?

Hi @upen_raj and welcome on this community forum !

The log that you’ve reported doesn’t contain enough information.
Could you please share with us the content of logs/web.log and logs/es.log ?

Thanks

I got this issue resolved. The jdk11 which I had used had incomplete files. Using a correct jdk11 rpm fixed it. Thanks.

In the sonarqube docker container, can you tell me how to start and stop sonar if you exec on to the container.