docker - Sonarqube docker容器无法重新启动,离线

标签 docker sonarqube sonarqube-ops

背景:我在代理/防火墙后面有一个系统。我可以访问docker提取图像,但是没有用户名/密码来访问任何其他站点。因此,我的sonarqube docker 容器实际上是离线的。

问题:Docker容器第一次启动正常,但无法重新启动。这种情况发生在两种情况下,要么是手动安装的插件出现错误,导致它未能下载更新中心网址,要么只是在启动时立即开始关闭。两者都使关闭容器的应用程序失败。我似乎无法(或不知道如何)修改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问题,您必须创建一个卷并安装temp文件夹(请注意,我使用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问题,解决方法是使用run命令指定配置(这特定于Godin的sonarqube docker 容器-通过他的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

关于docker - Sonarqube docker容器无法重新启动,离线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48714618/

相关文章:

docker - Docker容器可以在其中共享目录吗

python - 如何使用 Docker 容器内的 python 套接字连接到服务器?

sonarqube - sonar-project.properties 文件是否仅适用于 SonarQube Runner?

linux - Sonarqube在Centos7上加载css和js相关内容失败

sonarqube - 为什么 SonarQube 6.0 临时文件夹中有大量旧数据(总共 36GB)?

docker - 将env var从jenkinsfile内的docker run命令传递到dockerfile

.net-core - OpenCover 未上传到 Azure Devops

sonarqube - 使用一个数据库运行两个 Sonar 实例

elasticsearch - 将 Sonarqube 6.7 连接到外部 Elasticsearch

Docker端口冲突,即使没有绑定(bind)端口