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.

  • Docker bash'ing with find
  • How can I cleanly remove a container image from the Google Container Registry?
  • Mystery of the Restarting Docker Container
  • Multi-node Hadoop cluster with Docker
  • How to fake cpu architecture in docker container?
  • How should I create a Dockerfile to run more than one services in one instance?
  • 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.

  • selinux issues with Openshift 3.4 with dynamic persistant volumes using glusterfs
  • can i create instances in Openstack using vagrant or docker?
  • Link containers in Azure Container Service with Mesos & Marathon
  • Embed code in docker container or mount it as a volume?
  • Setting DOCKER_HOST after Docker Toolbox/Mac install
  • Is it possible change date in docker container?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.