在docker-compose的Sonarqube实例中安装Node.Js [英] Install Node.Js in a Sonarqube instance on the docker-compose

查看:264
本文介绍了在docker-compose的Sonarqube实例中安装Node.Js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想通过 docker-compose 在Docker上启动SonarQube。这是我的 .yml 文件:

so I'm trying to launch SonarQube on the docker through docker-compose. This is my .yml file:

version: "3"


services:
  sonarqube:
    image: sonarqube
    ports:
     - "9000:9000"
     - "5432:5432"
    links:
      - db:db
    environment:
     - SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
     - SONARQUBE_JDBC_USERNAME=postgres
     - SONARQUBE_JDBC_PASSWORD=sonar
    volumes:
     - ..../Work/tools/_SonarQube_home/conf:/opt/sonarqube/conf
#     - sonarqube_data:/opt/sonarqube_new/data
     - ...../Work/tools/_SonarQube_home/data:/opt/sonarqube/data
     - ....../Work/tools/_SonarQube_home/extensions:/opt/sonarqube/extensions
     - ..../Work/tools/_SonarQube_home/bundled-plugins:/opt/sonarqube/lib/bundled-plugins

  db:
    image: postgres
    environment:
     - POSTGRES_USER=postgres
     - POSTGRES_PASSWORD=sonar
     - POSTGRES_DB=sonar
    volumes:
     - .../Work/tools/_PostgreSQL_data:/var/lib/postgresql
     # This needs explicit mapping due to https://github.com/docker-library/postgres/blob/4e48e3228a30763913ece952c611e5e9b95c8759/Dockerfile.template#L52
     - ..../Work/tools/_PostgreSQL_data/data:/var/lib/postgresql/data

一切正常启动,并且工作正常。然后,我启动了对项目的分析,并得到此错误:

Everything boots up and works kind of correctly. Then I'm lauching the analysis of the project and get this error:

INFO: Sensor JavaScript analysis [javascript]
ERROR: Failed to parse Node.js version, got 'Couldn't find the Node.js binary. Ensure you have Node.js installed.

如果这是常规安装,则只添加NodeJ,但它是docker。

If this would be regular install, I'd just add NodeJs, but it's docker.

我该如何解决?
谢谢!

How should I fix this? Thanks!

推荐答案

谢谢大家的回答,尤其是@ leeman24,这是如何处理的真知灼见。

Thank you guys for the answers, especially @leeman24, that is awesome insight how to deal with docker images.

尽管真正的解决方案是在我的计算机上安装NodeJS,而不是在扫描仪服务器计算机上安装。换句话说,服务器开箱即可。

Although the real solution turned out to be installing NodeJS on MY machine, not the scanner server machine. In other words, server is fine out of the box.

这篇关于在docker-compose的Sonarqube实例中安装Node.Js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆