Sonar scan inside docker file

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube developer
  • what are you trying to achieve
    Merge request analisys

Hello everyone.

I’m trying to setup a gitlab pipeline to analysis our code, and when I run sonar scanner right from gitlabci.yaml, this works fine, but I’m trying to run a docker build process and then on the docker file I have the sonar scanner process.
And with that, Sonarqube is identifying that it is analysing the main branch, not the merge request.
I checked and I have the .git folder on the build process.

Hey there.

I would reckon that the right environment variables aren’t being found when running in the docker environment. Take a look at this thread:

1 Like