docker-library / openjdk

Docker Official Image packaging for EA builds of OpenJDK from Oracle
http://openjdk.java.net
MIT License
1.14k stars 476 forks source link

Strange crash of sonarqube builds running on top of openjdk:8-alpine on Linux #250

Closed ghost closed 6 years ago

ghost commented 6 years ago

I'm puzzled by crashes at runtime of SonarQube built on top of openjdk:8-alpine, on Linux hosts.

Relevant log from the crash of SonarQube 6.7.5-alpine:

2018.11.23 14:20:27 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process6376838719374991114properties
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/Context
    at org.sonar.server.app.WebServer.main(WebServer.java:89)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.Context
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 1 more

Relevant log from the crash of SonarQube 6.7.6-community-alpine, same as from 7.4-community-alpine:

2018.11.23 10:56:06 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process8139424421906286412properties
Error: Could not find or load main class org.sonar.server.app.WebServer

I run the built images with the simplest possible command, docker run imagename.

If I do the same on OSX, it works, I only get the above errors on Linux.

I see others have similar issues, strangely on first run only. For example if I run docker run -it imagename bash, and then within the container /opt/sonarqube/bin/run.sh, the first run fails and the 2nd and subsequent runs work fine.

What's going on?

wglambert commented 6 years ago

I haven't been able to reproduce on Ubuntu with Docker version 18.06.1-ce, tried with and without passing docker options. Maybe it's an image corruption, you could try purging the layers and repulling

$ docker run --rm -dit --name sonarqube sonarqube:6.7-alpine ```console $ docker logs -f sonarqube 2018.11.26 18:06:23 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp 2018.11.26 18:06:23 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001 2018.11.26 18:06:23 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es 2018.11.26 18:06:23 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running 2018.11.26 18:06:23 INFO app[][o.e.p.PluginsService] no modules loaded 2018.11.26 18:06:23 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.11.26 18:06:32 INFO app[][o.s.a.SchedulerImpl] Process[es] is up 2018.11.26 18:06:32 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process1165317859025837529properties 2018.11.26 18:06:32 INFO web[][o.s.p.ProcessEntryPoint] Starting web 2018.11.26 18:06:32 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read 2018.11.26 18:06:33 INFO web[][o.e.p.PluginsService] no modules loaded 2018.11.26 18:06:33 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin] 2018.11.26 18:06:33 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin] 2018.11.26 18:06:33 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin] 2018.11.26 18:06:33 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.11.26 18:06:34 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001] 2018.11.26 18:06:34 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 6.7.0.33306 / 5d031d9d2ac3f69b4b9bc600d50563b1886c7d8b 2018.11.26 18:06:35 INFO web[][o.s.s.p.d.EmbeddedDatabase] Starting embedded database on port 9092 with url jdbc:h2:tcp://127.0.0.1:9092/sonar 2018.11.26 18:06:35 INFO web[][o.s.s.p.d.EmbeddedDatabase] Embedded database started. Data stored in: /opt/sonarqube/data 2018.11.26 18:06:35 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://127.0.0.1:9092/sonar 2018.11.26 18:06:35 WARN web[][o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only 2018.11.26 18:06:35 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube 2018.11.26 18:06:35 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled 2018.11.26 18:06:36 INFO web[][o.s.s.p.d.m.h.MigrationHistoryTableImpl] Creating table schema_migrations 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarTS [typescript] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarQube :: Plugins :: SCM :: SVN [scmsvn] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarJava [java] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarQube :: Plugins :: SCM :: Git [scmgit] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarJS [javascript] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarPython [python] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarC# [csharp] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarPHP [php] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin Flex [flex] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarXML [xml] installed 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Flex / 2.3 / 79167f762219bea1fd181ff5ef6ca4b34abd1675 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 6.5.0.3766 / 6011a1e9fb002edb044ae3092d92bcfb7d9d8a2d 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 3.2.0.5506 / 86da09565f891121df248835665f5d8ed98772b6 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 4.15.0.12310 / 572454b93016ec73a53fe0e07b2ffdc356d21ba9 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 2.11.0.2485 / 741861a29e5f9a26c6c99c06268facb6c4f4a882 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.8.0.1496 / 3fe3bc4d0273a5721ea2fb368dc45b1bb82fede3 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: Git / 1.3.0.869 / 4da53e3f9e55f4f2e5796625cb0c5768ed152079 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: SVN / 1.6.0.860 / 2111fdbd1dddda4ad6d4ed6486fd0b18c1010d3b 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.1.0.1079 / 042c9e65239a47d92d305f9767f730b3cc1e5ed3 2018.11.26 18:06:36 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 1.4.3.1027 / 39588245cecf538bb27be4e496ff303b0143d20b 2018.11.26 18:06:36 INFO web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install 2018.11.26 18:06:36 INFO web[][o.s.s.p.Platform] Database has been automatically updated 2018.11.26 18:06:36 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@1cc7bd52 [pattern=UrlPattern{inclusions=[/api/system/migrate_db/*, ...], exclusions=[/api/properties*, ...]}] 2018.11.26 18:06:36 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000 2018.11.26 18:06:37 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy) 2018.11.26 18:06:38 INFO web[][o.s.s.e.IndexCreator] Create index metadatas 2018.11.26 18:06:39 INFO web[][o.s.s.e.IndexCreator] Create type metadatas/metadata 2018.11.26 18:06:39 INFO web[][o.s.s.e.IndexCreator] Create index components 2018.11.26 18:06:39 INFO web[][o.s.s.e.IndexCreator] Create type components/component 2018.11.26 18:06:39 INFO web[][o.s.s.e.IndexCreator] Create type components/authorization 2018.11.26 18:06:39 INFO web[][o.s.s.e.IndexCreator] Create index tests 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type tests/test 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create index projectmeasures 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type projectmeasures/projectmeasure 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type projectmeasures/authorization 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create index rules 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type rules/activeRule 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type rules/ruleExtension 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type rules/rule 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create index issues 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type issues/issue 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create type issues/authorization 2018.11.26 18:06:40 INFO web[][o.s.s.e.IndexCreator] Create index users 2018.11.26 18:06:41 INFO web[][o.s.s.e.IndexCreator] Create type users/user 2018.11.26 18:06:41 INFO web[][o.s.s.e.IndexCreator] Create index views 2018.11.26 18:06:41 INFO web[][o.s.s.e.IndexCreator] Create type views/view 2018.11.26 18:06:41 INFO web[][o.s.s.s.LogServerId] Server ID: AWdRM59iJCPxHm-vrGj3 2018.11.26 18:06:41 INFO web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled. 2018.11.26 18:06:41 INFO web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.) 2018.11.26 18:06:41 INFO web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index 2018.11.26 18:06:41 INFO web[][o.s.s.s.RegisterPlugins] Register plugins 2018.11.26 18:06:41 INFO web[][o.s.s.s.RegisterMetrics] Register metrics 2018.11.26 18:06:42 INFO web[][o.s.s.r.RegisterRules] Register rules 2018.11.26 18:06:49 INFO web[][o.s.s.q.BuiltInQProfileRepositoryImpl] Load quality profiles 2018.11.26 18:06:49 INFO web[][o.s.s.q.RegisterQualityProfiles] Register quality profiles 2018.11.26 18:06:49 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile cs/Sonar way 2018.11.26 18:06:50 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile java/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile xml/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile flex/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile js/Sonar way Recommended 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile js/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile php/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile php/PSR-2 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile php/Drupal 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile py/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile ts/Sonar way 2018.11.26 18:06:51 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile ts/Sonar way recommended 2018.11.26 18:06:51 INFO web[][o.s.s.s.RegisterPermissionTemplates] Register permission templates 2018.11.26 18:06:51 INFO web[][o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@4ef24a11 [pattern=UrlPattern{inclusions=[/api/measures/component/*, ...], exclusions=[/api/properties*, ...]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.DeprecatedPropertiesWsFilter@e649969 [pattern=UrlPattern{inclusions=[/api/properties/*], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceReroutingFilter@78d56982 [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, ...], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@7a319171 [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@2e3bd2cf [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@ab472d7 [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@e809b58 [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@1d38b36d [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=[]}] 2018.11.26 18:06:51 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [rules/activeRule] ... 2018.11.26 18:06:52 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [rules/activeRule] done | time=936ms 2018.11.26 18:06:52 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [rules/ruleExtension],[rules/rule] ... 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [rules/ruleExtension],[rules/rule] done | time=1670ms 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [users/user] ... 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [users/user] done | time=222ms 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [components/component] ... 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [components/component] done | time=53ms 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [views/view] ... 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [views/view] done | time=60ms 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [issues/issue] ... 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [issues/issue] done | time=70ms 2018.11.26 18:06:54 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [components/authorization],[issues/authorization],[projectmeasures/authorization] ... 2018.11.26 18:06:55 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [components/authorization],[issues/authorization],[projectmeasures/authorization] done | time=78ms 2018.11.26 18:06:55 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [tests/test] ... 2018.11.26 18:06:55 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [tests/test] done | time=53ms 2018.11.26 18:06:55 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [projectmeasures/projectmeasure] ... 2018.11.26 18:06:55 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [projectmeasures/projectmeasure] done | time=112ms 2018.11.26 18:06:55 INFO web[][o.s.s.p.Platform] WebServer is operational 2018.11.26 18:06:55 INFO app[][o.s.a.SchedulerImpl] Process[web] is up 2018.11.26 18:06:55 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='ce', ipcIndex=3, logFilenamePrefix=ce]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:./lib/ce/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.ce.app.CeServer /opt/sonarqube/temp/sq-process6311776042293894220properties 2018.11.26 18:06:55 INFO ce[][o.s.p.ProcessEntryPoint] Starting ce 2018.11.26 18:06:55 INFO ce[][o.s.ce.app.CeServer] Compute Engine starting up... 2018.11.26 18:06:56 INFO ce[][o.e.p.PluginsService] no modules loaded 2018.11.26 18:06:56 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin] 2018.11.26 18:06:56 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin] 2018.11.26 18:06:56 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin] 2018.11.26 18:06:56 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.11.26 18:06:57 INFO ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001] 2018.11.26 18:06:57 INFO ce[][o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://127.0.0.1:9092/sonar 2018.11.26 18:06:57 WARN ce[][o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only 2018.11.26 18:06:57 INFO ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube 2018.11.26 18:06:58 INFO ce[][o.s.c.c.CePluginRepository] Load plugins 2018.11.26 18:07:00 INFO ce[][o.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Wed May 30 18:07:00 GMT 2018 2018.11.26 18:07:00 INFO ce[][o.s.ce.app.CeServer] Compute Engine is operational 2018.11.26 18:07:00 INFO app[][o.s.a.SchedulerImpl] Process[ce] is up 2018.11.26 18:07:00 INFO app[][o.s.a.SchedulerImpl] SonarQube is up ```
$ docker run sonarqube:6.7-alpine ```console 2018.11.26 18:12:39 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp 2018.11.26 18:12:39 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001 2018.11.26 18:12:39 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es 2018.11.26 18:12:39 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running 2018.11.26 18:12:39 INFO app[][o.e.p.PluginsService] no modules loaded 2018.11.26 18:12:39 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.11.26 18:12:49 INFO app[][o.s.a.SchedulerImpl] Process[es] is up 2018.11.26 18:12:49 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process4799921115222795905properties 2018.11.26 18:12:49 INFO web[][o.s.p.ProcessEntryPoint] Starting web 2018.11.26 18:12:50 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read 2018.11.26 18:12:51 INFO web[][o.e.p.PluginsService] no modules loaded 2018.11.26 18:12:51 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin] 2018.11.26 18:12:51 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin] 2018.11.26 18:12:51 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin] 2018.11.26 18:12:51 INFO web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.11.26 18:12:52 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001] 2018.11.26 18:12:52 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 6.7.0.33306 / 5d031d9d2ac3f69b4b9bc600d50563b1886c7d8b 2018.11.26 18:12:53 INFO web[][o.s.s.p.d.EmbeddedDatabase] Starting embedded database on port 9092 with url jdbc:h2:tcp://127.0.0.1:9092/sonar 2018.11.26 18:12:53 INFO web[][o.s.s.p.d.EmbeddedDatabase] Embedded database started. Data stored in: /opt/sonarqube/data 2018.11.26 18:12:53 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://127.0.0.1:9092/sonar 2018.11.26 18:12:53 WARN web[][o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube 2018.11.26 18:12:54 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled 2018.11.26 18:12:54 INFO web[][o.s.s.p.d.m.h.MigrationHistoryTableImpl] Creating table schema_migrations 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarTS [typescript] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarQube :: Plugins :: SCM :: SVN [scmsvn] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarJava [java] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarQube :: Plugins :: SCM :: Git [scmgit] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarJS [javascript] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarPython [python] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarC# [csharp] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarPHP [php] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin Flex [flex] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Plugin SonarXML [xml] installed 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin Flex / 2.3 / 79167f762219bea1fd181ff5ef6ca4b34abd1675 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarC# / 6.5.0.3766 / 6011a1e9fb002edb044ae3092d92bcfb7d9d8a2d 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJS / 3.2.0.5506 / 86da09565f891121df248835665f5d8ed98772b6 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarJava / 4.15.0.12310 / 572454b93016ec73a53fe0e07b2ffdc356d21ba9 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPHP / 2.11.0.2485 / 741861a29e5f9a26c6c99c06268facb6c4f4a882 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarPython / 1.8.0.1496 / 3fe3bc4d0273a5721ea2fb368dc45b1bb82fede3 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: Git / 1.3.0.869 / 4da53e3f9e55f4f2e5796625cb0c5768ed152079 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarQube :: Plugins :: SCM :: SVN / 1.6.0.860 / 2111fdbd1dddda4ad6d4ed6486fd0b18c1010d3b 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarTS / 1.1.0.1079 / 042c9e65239a47d92d305f9767f730b3cc1e5ed3 2018.11.26 18:12:54 INFO web[][o.s.s.p.ServerPluginRepository] Deploy plugin SonarXML / 1.4.3.1027 / 39588245cecf538bb27be4e496ff303b0143d20b 2018.11.26 18:12:54 INFO web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install 2018.11.26 18:12:55 INFO web[][o.s.s.p.Platform] Database has been automatically updated 2018.11.26 18:12:55 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@5f8358ed [pattern=UrlPattern{inclusions=[/api/system/migrate_db/*, ...], exclusions=[/api/properties*, ...]}] 2018.11.26 18:12:55 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000 2018.11.26 18:12:56 INFO web[][o.s.s.p.UpdateCenterClient] Update center: https://update.sonarsource.org/update-center.properties (no proxy) 2018.11.26 18:12:57 INFO web[][o.s.s.e.IndexCreator] Create index metadatas 2018.11.26 18:12:57 INFO web[][o.s.s.e.IndexCreator] Create type metadatas/metadata 2018.11.26 18:12:58 INFO web[][o.s.s.e.IndexCreator] Create index components 2018.11.26 18:12:58 INFO web[][o.s.s.e.IndexCreator] Create type components/component 2018.11.26 18:12:58 INFO web[][o.s.s.e.IndexCreator] Create type components/authorization 2018.11.26 18:12:58 INFO web[][o.s.s.e.IndexCreator] Create index tests 2018.11.26 18:12:58 INFO web[][o.s.s.e.IndexCreator] Create type tests/test 2018.11.26 18:12:58 INFO web[][o.s.s.e.IndexCreator] Create index projectmeasures 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type projectmeasures/projectmeasure 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type projectmeasures/authorization 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create index rules 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type rules/activeRule 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type rules/ruleExtension 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type rules/rule 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create index issues 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type issues/issue 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create type issues/authorization 2018.11.26 18:12:59 INFO web[][o.s.s.e.IndexCreator] Create index users 2018.11.26 18:13:00 INFO web[][o.s.s.e.IndexCreator] Create type users/user 2018.11.26 18:13:00 INFO web[][o.s.s.e.IndexCreator] Create index views 2018.11.26 18:13:00 INFO web[][o.s.s.e.IndexCreator] Create type views/view 2018.11.26 18:13:00 INFO web[][o.s.s.s.LogServerId] Server ID: AWdROWaV55FxqbOxA9jX 2018.11.26 18:13:00 INFO web[][o.s.s.t.TelemetryDaemon] Sharing of SonarQube statistics is enabled. 2018.11.26 18:13:00 INFO web[][o.s.s.n.NotificationDaemon] Notification service started (delay 60 sec.) 2018.11.26 18:13:00 INFO web[][o.s.s.s.GeneratePluginIndex] Generate scanner plugin index 2018.11.26 18:13:00 INFO web[][o.s.s.s.RegisterPlugins] Register plugins 2018.11.26 18:13:00 INFO web[][o.s.s.s.RegisterMetrics] Register metrics 2018.11.26 18:13:00 INFO web[][o.s.s.r.RegisterRules] Register rules 2018.11.26 18:13:08 INFO web[][o.s.s.q.BuiltInQProfileRepositoryImpl] Load quality profiles 2018.11.26 18:13:08 INFO web[][o.s.s.q.RegisterQualityProfiles] Register quality profiles 2018.11.26 18:13:08 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile cs/Sonar way 2018.11.26 18:13:09 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile java/Sonar way 2018.11.26 18:13:09 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile xml/Sonar way 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile flex/Sonar way 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile js/Sonar way Recommended 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile js/Sonar way 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile php/Sonar way 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile php/PSR-2 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile php/Drupal 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile py/Sonar way 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile ts/Sonar way 2018.11.26 18:13:10 INFO web[][o.s.s.q.RegisterQualityProfiles] Register profile ts/Sonar way recommended 2018.11.26 18:13:10 INFO web[][o.s.s.s.RegisterPermissionTemplates] Register permission templates 2018.11.26 18:13:10 INFO web[][o.s.s.s.RenameDeprecatedPropertyKeys] Rename deprecated property keys 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@628e3c90 [pattern=UrlPattern{inclusions=[/api/measures/component/*, ...], exclusions=[/api/properties*, ...]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.DeprecatedPropertiesWsFilter@a0f4a42 [pattern=UrlPattern{inclusions=[/api/properties/*], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceReroutingFilter@15132588 [pattern=UrlPattern{inclusions=[/api/components/bulk_update_key, ...], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.InitFilter@5e9fa20e [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.OAuth2CallbackFilter@34f40d53 [pattern=UrlPattern{inclusions=[/oauth2/callback/*], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LoginAction@3f35d98 [pattern=UrlPattern{inclusions=[/api/authentication/login], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.LogoutAction@15b97450 [pattern=UrlPattern{inclusions=[/api/authentication/logout], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.authentication.ws.ValidateAction@541a6c62 [pattern=UrlPattern{inclusions=[/api/authentication/validate], exclusions=[]}] 2018.11.26 18:13:10 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [rules/activeRule] ... 2018.11.26 18:13:11 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [rules/activeRule] done | time=909ms 2018.11.26 18:13:11 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [rules/ruleExtension],[rules/rule] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [rules/ruleExtension],[rules/rule] done | time=2583ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [users/user] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [users/user] done | time=233ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [components/component] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [components/component] done | time=65ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [views/view] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [views/view] done | time=76ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [issues/issue] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [issues/issue] done | time=57ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [components/authorization],[issues/authorization],[projectmeasures/authorization] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of types [components/authorization],[issues/authorization],[projectmeasures/authorization] done | time=63ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [tests/test] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [tests/test] done | time=63ms 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [projectmeasures/projectmeasure] ... 2018.11.26 18:13:14 INFO web[][o.s.s.e.IndexerStartupTask] Indexing of type [projectmeasures/projectmeasure] done | time=53ms 2018.11.26 18:13:14 INFO web[][o.s.s.p.Platform] WebServer is operational 2018.11.26 18:13:15 INFO app[][o.s.a.SchedulerImpl] Process[web] is up 2018.11.26 18:13:15 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='ce', ipcIndex=3, logFilenamePrefix=ce]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:./lib/ce/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.ce.app.CeServer /opt/sonarqube/temp/sq-process8477382521324476562properties 2018.11.26 18:13:15 INFO ce[][o.s.p.ProcessEntryPoint] Starting ce 2018.11.26 18:13:15 INFO ce[][o.s.ce.app.CeServer] Compute Engine starting up... 2018.11.26 18:13:16 INFO ce[][o.e.p.PluginsService] no modules loaded 2018.11.26 18:13:16 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin] 2018.11.26 18:13:16 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin] 2018.11.26 18:13:16 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin] 2018.11.26 18:13:16 INFO ce[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.11.26 18:13:17 INFO ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001] 2018.11.26 18:13:17 INFO ce[][o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://127.0.0.1:9092/sonar 2018.11.26 18:13:17 WARN ce[][o.s.d.DatabaseChecker] H2 database should be used for evaluation purpose only 2018.11.26 18:13:18 INFO ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube 2018.11.26 18:13:18 INFO ce[][o.s.c.c.CePluginRepository] Load plugins 2018.11.26 18:13:20 INFO ce[][o.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Wed May 30 18:13:20 GMT 2018 2018.11.26 18:13:20 INFO ce[][o.s.ce.app.CeServer] Compute Engine is operational 2018.11.26 18:13:20 INFO app[][o.s.a.SchedulerImpl] Process[ce] is up 2018.11.26 18:13:20 INFO app[][o.s.a.SchedulerImpl] SonarQube is up ```
KengoTODA commented 6 years ago

I tried to run purged image on Ubuntu 18.04.1 with docker-ce 18.09.0, and it still has problem:

$ docker -v
Docker version 18.09.0, build 4d60db4
$ docker run sonarqube:6.7-alpine
2018.11.27 04:13:46 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.11.27 04:13:46 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.11.27 04:13:46 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es
2018.11.27 04:13:46 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.11.27 04:13:46 INFO  app[][o.e.p.PluginsService] no modules loaded
2018.11.27 04:13:46 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.11.27 04:13:53 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2018.11.27 04:13:53 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-1.8-openjdk/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/h2/h2-1.3.176.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process6392450656198437664properties
Error: Could not find or load main class org.sonar.server.app.WebServer
2018.11.27 04:13:53 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [web]: 1
2018.11.27 04:13:53 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.11.27 04:13:53 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.11.27 04:13:53 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
2018.11.27 04:13:53 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
tianon commented 6 years ago

I can reproduce, but unfortunately don't have any ideas for root cause. Java on Alpine is pretty experimental to begin with (to put it lightly). There was an effort to make it officially supported for OpenJDK 11, but it didn't get the attention it needed to in time, so was removed at the final GA release. See https://github.com/docker-library/openjdk/issues/211, especially https://github.com/docker-library/openjdk/issues/211#issuecomment-438173628 (and also https://github.com/docker-library/openjdk/pull/235#issuecomment-424599754).

KengoTODA commented 6 years ago

Not sure why, but it randomly successes even on Ubuntu.

And following patch for docker-sonarqube can stabilize this behaviour. Maybe this is related with user, permission or workdir for launched process by ProcessBuilder, I guess.

diff --git a/6.7.5-alpine/Dockerfile b/6.7.5-alpine/Dockerfile
index b1fc9e6..606dcf0 100644
--- a/6.7.5-alpine/Dockerfile
+++ b/6.7.5-alpine/Dockerfile
@@ -42,3 +42,5 @@ VOLUME "$SONARQUBE_HOME/data"
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
 ENTRYPOINT ["./bin/run.sh"]
+RUN chown -R sonarqube:sonarqube $SONARQUBE_HOME
+USER sonarqube
diff --git a/6.7.5-alpine/run.sh b/6.7.5-alpine/run.sh
index e1da369..a90c203 100755
--- a/6.7.5-alpine/run.sh
+++ b/6.7.5-alpine/run.sh
@@ -7,8 +7,7 @@ if [ "${1:0:1}" != '-' ]; then
 fi

 chown -R sonarqube:sonarqube $SONARQUBE_HOME
-exec su-exec sonarqube \
-  java -jar lib/sonar-application-$SONAR_VERSION.jar \
+java -jar lib/sonar-application-$SONAR_VERSION.jar \
   -Dsonar.log.console=true \
   -Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \
   -Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \
ghost commented 6 years ago

Very. Interesting. BIG thank you @KengoTODA! This seems to do the trick, the alpine-based image no longer crashes.

A small thing, with this change, I'm no longer able to stop a running container with Ctrl-C, I need to use docker commands to stop it. Does that ring any bells? Is that an issue? (I'm new to Docker.)

If I change java -jar ... to exec java -jar ..., then Ctrl-C works as before. Does that seem like a good solution?

tianon commented 6 years ago

That'd be because you dropped "exec" so the shell is still active as PID 1 and as such the signals get eaten there instead of passing forward to Java.

yosifkit commented 6 years ago

Closing since this does not seem to be an issue with the openjdk image and is being addressed in the sonarqube image.