Dockerized Jenkins and Sonarqube – Link to analysis in project incorrect

I’m running Jenkins and SonarQube in containers on Debian. The Jenkins image is started with the options --link sonar:sonar where sonar is the name of the running Sonar container. Hence, Jenkins’s /ets/hosts contains a hostname entry pointing to the ip of the dockerized Sonar. In the Sonar-config section (in Jenkins), sonar:9000 is entered as the Sonar server.

When building, the scanner runs as expected, but the Sonar-link in the project page contains the internal Docker-address, i.e. sonar:9000! This address is meaningless outside Docker. I want the link to point to the host machine. When I navigate directly to the host, port 9000, I am able to see Sonar’s analysis.

  • How to open a shell while/after running a Docker container without overriding existing CMD?
  • deploy war file on tomcat docker container
  • What deletes docker images periodically?
  • docker stop doesn't work for node process
  • Mysql container can not mount data to a nfs folder
  • Jenkins Slave can't read settings.xml
  • How can I separate the url to Sonar which is used by Jenkins in the build process and the url which is displayed in the project-build page?

    Here is a screenshot from the Project Build page in Sonar build page

    The Sonarcube link is pointing to the URL which is set in Manage Jenkins->Configure System under Sonarqube Servers. In this instance, the url is sonar:9000, which is the hostname that is known for the container running Jenkins. This URL is meaningless outside of the container. It should be possible to enter one internal URL for the server and one external for the Jenkins users.

  • How to connect to remote docker instance using virtual private network
  • docker enterprise solution?
  • Symfony2 app slow response on MacOS & Boot2Docker
  • How to connect to MongoDB running in Docker container?
  • Docker volume size limit on BlueMix
  • What is the difference between import and load in Docker?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.