简体   繁体   中英

Configure SonarQube on Jenkins

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM