IntelliJ 无法连接到 Docker 中的 SonarQube 服务器 运行

IntelliJ unable to connect to SonarQube Server running in Docker

我正在 Docker 中尝试连接到我机器上的 SonarQube 服务器 运行ning。 我在 IntelliJ 中安装了 SonarLint 插件,当我创建到服务器的新连接时,给插件的令牌,它显示:

Failed to connect the server. Please check the configuration. Error: Fail to request http://localhost:9000/api/system/status

这个URL在浏览器中有效,回馈

{"id":"BF41A1F2-AWlcxJRKJ9-nWLU3WeGl","version":"7.6.0.21501","status":"UP"}

在 SonarLint 日志中它说:

Caused by: java.net.ProtocolException: Unexpected status line:

我刚刚从 docker 存储库中提取了最后一个声纳库图像,运行 它只有端口转发选项 (-p 9000:9000)

我的环境:

我找到了解决方法。 使用机器名称代替 localhost。