在根目录下,我使用:dotnet tool install --global dotnet-sonarscanner --version 4.7.1安装了sonarscanner,它正在工作:
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
WARNING: Please specify the command 'begin' or 'end' to indicate whether pre- or post-processing is required. These parameters will become mandatory in a later release.
Post-processing started.但在码头上却并非如此:
root@3bea636a6418:/# dotnet sonarscanner
bash: dotnet: command not found我试着通过它:
export PATH="$PATH:/root/.dotnet/tools"但不走运
ps。...and由于sonarscanner在docker上找不到java而导致的一切:
SonarScanner for MSBuild 5.2
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarScanner CLI…
Could not find ‘java’ executable in JAVA_HOME or PATH.
The SonarScanner did not complete successfully
14:43:39.402 Post-processing failed. Exit code: 1
Cleaning up file based variables
ERROR: Job failed: exit code 1```发布于 2021-04-28 17:11:31
安装dotnet工具的所有依赖项才能工作,ldd命令可以帮助您,并确保可以找到所有需要的软件,例如,如果需要,可以在PATH变量上找到。
以帮助您在docker容器上使用交互式bash,如果可以,还可以添加到dockerfile中。docker exec -it (container) bash
docker镜像通常只安装所需的内容,因此您只需添加工具即可成功运行软件。
发布于 2021-04-29 17:19:11
- apt-get update
- apt-get install --yes openjdk-11-jre 已解决的问题
ps。这并不明显,因为在docker bash中,当我运行java -version时,我得到的答案是java已经安装
https://stackoverflow.com/questions/67290989
复制相似问题