0 files indexed when using sonar-scanner docker container

I am trying to setup sonar-scanner for a Java project. This is the command to run sonar:

$ docker run --rm --network=host -it -e SONAR_HOST_URL="http://localhost:9000/"  -v "${PWD}:/usr/src" sonarsource/sonar-scanner-cli -Dsonar.projectKey="my:foobar" -Dsonar.login=sometoken

The result then is

INFO: Indexing files...
INFO: Project configuration:
INFO: 0 files indexed

As a consequence, the result page in the sonar UI is entirely empty.

The sonar instance that I use is the latest community edition: 8.6.1. All of that takes place on a Windows 10 machine.

If there are any logs - how do I get to them inside the docker container?

Problem solved.

The issue was with the shared volume. I used git bash to execute the command. Therefore, the volume’s directory path was expanded to a Unix-based format. However, Docker seems to expect the Windows path format. By issueing the command in Powershell or by specifying the path manually, I managed to circumvent this behavior.

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