SonarQube - Dockerfile cannot be scanned

SonarQube Developer Edition v9.9.6 (build 92038)

I am trying to scan a Dockerfile, but cannot make it work.
Documentation states:

By default, all files named Dockerfile, Dockerfile.*, or *.dockerfile are considered Dockerfiles

Docker analysis is enabled under settings:

but in the scan logs, I see following:
08:46:13 03:16:13.378 DEBUG ‘src/Dockerfile’ indexed with no language
08:46:13 03:16:13.379 DEBUG ‘src/Dockerfile.jvm’ indexed with no language
08:46:13 03:16:13.380 DEBUG ‘src/Dockerfile.native’ indexed with no language
08:46:13 03:16:13.382 DEBUG ‘src/Dockerfile.native-micro’ indexed with no language

Is this a bug with v9.9.6 (build 92038) ? I saw similar topic related to SonarCloud where something was fixed, but not sure how it impacts SonarQube.

Hi,

Could you post your full, debug analysis log, please?

 
Thx,
Ann

Here it is:
consoleText.txt (49.4 KB)

Hi,

Thanks for that. Are you comfortable sharing the files publicly?

 
Thx,
Ann

What do you need ? Dockerfile ? If so, would prefer a private message.

Hi,

Yes, the dockerfiles. I’ve flagged this for the language experts. They’ll send you a PM so you can send the files privately.

 
Ann

Hi @richmond
I send you a private message.

Best
Marcin

The root cause is an empty comment in the Dockerfile (line 1):

#
FROM scratch

This issue was fixed with SONARIAC-592, which is available in SonarQube Server >= 10.0. Also, a lot of other improvements were introduced in the Docker analyzer, so I recommend testing the new SonarQube Server and upgrade if possible.

Best
Marcin Stachniuk

2 Likes

Thanks. I will try this out after upgrade.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.