Sonar scanner with docker is very slow compared to the local one

  • which versions are you using (SonarQube, Scanner):
    • SonarQube community version 9.8 running in docker by the official guide.
    • Scanner with the local setup is 4.7 (just unzipping the zip file and running the bat file - windows user) while the docker one is version 4.8 (not sure while the versions are not aligned I use the guide here for both options - SonarScanner. )
  • what are you trying to achieve
    • Uploading code and coverage to SonarQube to generate a report of the new code (branch compared to the master)
  • what have you tried so far to achieve this
    • Running the scanner multiple times with both options. For example, running the scanner with docker took 5:18.185s while with the local version it only took 1:23.057s.

All the configurations for the report, coverage, connection, etc are defined in the sonar-project.properties file and I didn’t change any of them except for the connection.
When using the local version it’s sonar.host.url=http://localhost:9000 while when using docker it’s sonar.host.url=http://172.23.16.1:9000 since docker needs to point to the docker-machine host IP and not “localhost”.

The SonarQube server is working fine and I do see in the project activity that both scans and upload of coverage are represented properly. The only issue I’m raising is the gap in the time difference between those 2 methods. I’m not sure why this is the case, I tried to run it multiple times and the gap is always around 3 minutes.
I couldn’t find any information about this on this forum or googling it.

Hi,

Welcome to the community!

Thanks for this report. Can you provide your analysis logs for both?

 
Thx,
Ann

I have those files, which one of them contains the analysis logs?

Hi,

Those are your server logs. Sorry I should have been more clear,

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann