Sonarqube与Postgres docker-compose。 Sonarqube无法正常工作

时间:2019-12-30 10:25:59

标签: postgresql docker-compose sonarqube

我正在使用docker-compose文件在postgres db上运行sonarqube。该文件是:

version: "2"

services:
  sonarqube:
    image: sonarqube:7.9-community
    container_name: sonarqube
    ports:
      - "9000:9000"
    networks:
      - sonarnet
    environment:
      - sonar.jdbc.url=jdbc:postgresql://db:5432/sonar
    volumes:
      - /opt/sonar_data/server_data/sonarqube/logs:/opt/sonarqube/logs
      - /opt/sonar_data/server_data/sonarqube/data:/opt/sonarqube/data
      - /opt/sonar_data/server_data/sonarqube/extensions:/opt/sonarqube/extensions

  db:
    image: postgres:11.4
    container_name: postgres
    networks:
      - sonarnet
    environment:
      - POSTGRES_USER=sonar
      - POSTGRES_PASSWORD=sonar
    volumes:
      - /opt/sonar_data/server_data/postgres/postgresql:/var/lib/postgresql
      - /opt/sonar_data/server_data/postgres/postgresql_data:/var/lib/postgresql/data

networks:
  sonarnet:
    driver: bridge

Postgres服务器容器工作正常,但是对于声纳服务器,我遇到以下问题:

2019.12.30 10:15:48 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
Exception in thread "main" java.nio.file.AccessDeniedException: /opt/sonarqube/temp/README.txt
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
        at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:245)
        at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
        at java.base/java.nio.file.Files.delete(Files.java:1141)
        at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:121)
        at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:101)
        at java.base/java.nio.file.Files.walkFileTree(Files.java:2724)
        at org.sonar.application.AppFileSystem.createOrCleanTempDirectory(AppFileSystem.java:96)
        at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:62)
        at org.sonar.application.App.start(App.java:62)
        at org.sonar.application.App.main(App.java:98)

我不知道该怎么办。以前,相同的配置可以工作,但现在却不行。我想运行相同版本的sonarqube和postgres。

0 个答案:

没有答案