Configure SonarQube on Jenkins

眉间皱痕 提交于 2020-01-06 06:42:14

问题


I have SonarQube and Jenkins dockerized(They're running on different containers); sonar is running on localhost:9000 and Jenkins is running on localhost:8080. I configured the Sonar credentials(with acces Token) on Jenkins, but i when run SonarScanner I'm getting the following error by SonarScaner on Jenkins:

ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: ---------------------------------------------------------------- 
INFO: EXECUTION FAILURE
INFO: ---------------------------------------------------------------- 
INFO: Total time: 0.358s
INFO: Final Memory: 4M/119M
INFO: ----------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to get bootstrap index from server
ERROR: Caused by: Failed to connect to localhost/127.0.0.1:9000
ERROR: Caused by: Connection refused (Connection refused)

Docker:

How could i solve this, or make that both containers communicate between each others?


回答1:


You can't use 127.0.0.1 as the IP address because that's the IP of the local container. You need to use the IP of the host.

I wrote an article on how to setup a Docker container of Jenkins and SonarQube to talk to each other that explains the setup.



来源:https://stackoverflow.com/questions/49908708/configure-sonarqube-on-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!