Sonarqube docker 容器重启失败,离线

Sonarqube docker container fails to restart, offline

背景:我在proxy/firewall后面有一个系统。我可以访问 docker 来提取图像,但没有 username/password 来访问任何其他站点。因此,我的 docker sonarqube 容器基本上处于离线状态。

问题:docker容器第一次启动正常,但重启失败。这种情况发生在两种情况下,要么是手动安装的插件出现无法下载更新中心 url 的错误,要么只是在启动时立即开始关闭。两者都使关闭容器的应用程序失败。我似乎无法(或理解如何)修改 sonar.properties 以禁用更新中心并需要指导。

我在 github 上查询了容器,但没有太多帮助:https://github.com/SonarSource/docker-sonarqube/issues/76#issuecomment-364563967 '-Dsonar.updatecenter.activate=false' 选项在我尝试时不起作用。

干脆关机

2018.02.09 21:45:38 INFO  ce[][o.s.p.ProcessEntryPoint] Starting ce
2018.02.09 21:45:38 INFO  ce[][o.s.ce.app.CeServer] Compute Engine starting     up...
2018.02.09 21:45:39 INFO  ce[][o.e.p.PluginsService] no modules loaded
2018.02.09 21:45:39 INFO  ce[][o.e.p.PluginsService] loaded plugin     [org.elasticsearch.index.reindex.ReindexPlugin]
2018.02.09 21:45:39 INFO  ce[][o.e.p.PluginsService] loaded plugin     [org.elasticsearch.join.ParentJoinPlugin]
2018.02.09 21:45:39 INFO  ce[][o.e.p.PluginsService] loaded plugin     [org.elasticsearch.percolator.PercolatorPlugin]
2018.02.09 21:45:39 INFO  ce[][o.e.p.PluginsService] loaded plugin org.elasticsearch.transport.Netty4Plugin]
2018.02.09 21:45:41 INFO  ce[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2018.02.09 21:45:41 INFO  ce[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://pgsonar:5432/sonar
2018.02.09 21:45:43 INFO  ce[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2018.02.09 21:45:43 INFO  ce[][o.s.c.c.CePluginRepository] Load plugins
2018.02.09 21:45:45 INFO  ce[][o.s.c.q.PurgeCeActivities] Delete the Compute Engine tasks created before Sun Aug 13 21:45:45 UTC 2017
2018.02.09 21:45:45 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is operational
2018.02.09 21:45:45 INFO  app[][o.s.a.SchedulerImpl] Process[ce] is up
2018.02.09 21:45:45 INFO  app[][o.s.a.SchedulerImpl] SonarQube is up
2018.02.09 21:47:12 INFO  app[][o.s.a.SchedulerImpl] Stopping SonarQube
2018.02.09 21:47:13 INFO  ce[][o.s.p.StopWatcher] Stopping process
2018.02.09 21:47:13 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is stopping...
2018.02.09 21:47:13 INFO  ce[][o.s.c.t.CeProcessingSchedulerImpl] Waiting for workers to finish in-progress tasks
2018.02.09 21:47:14 INFO  ce[][o.s.ce.app.CeServer] Compute Engine is stopped
2018.02.09 21:47:15 INFO  app[][o.s.a.SchedulerImpl] Process [ce] is stopped
2018.02.09 21:47:15 INFO  web[][o.s.p.StopWatcher] Stopping process
2018.02.09 21:47:18 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.02.09 21:47:18 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.02.09 21:47:18 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.02.09 21:47:18 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
chown: cannot access '/opt/sonarqube/temp/README.txt': No such file or directory

稍后将更新下载失败(此时无法访问日志)

关于 README.txt 问题,您必须创建一个卷并安装临时文件夹(请注意,我使用 anorak:girl 中的 postgres 设置)。然后您可以毫无问题地开始和停止。

sudo docker volume create sonarqube-temp
sudo docker run -d --name sonarqube --link sonar-postgres:pgsonar -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD='secure'  -e SONARQUBE_JDBC_URL=jdbc:postgresql://pgsonar:5432/sonar -v sonarqube-temp:/opt/sonarqube/temp sonarqube:lts

关于 UpdateCenter 问题,解决方法是使用 运行 命令指定配置(这特定于 Godin 的 docker sonarqube 容器 - 通过他的 run.sh 脚本):

sudo docker run -d --name sonarqube --link sonar-postgres:pgsonar -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD='secure'  -e SONARQUBE_JDBC_URL=jdbc:postgresql://pgsonar:5432/sonar -v sonarqube-temp:/opt/sonarqube/temp sonarqube:lts -Dsonar.updatecenter.activate=false