This shows how to build Sonar Scanner as a Docker image, so that you can run Sonar Scanner without having Java installed on the host.
The part where Node.JS is installed can be substituted with whatever is necessary to scan the target project.
- Build with
docker build -t sonar:scanner .
- Run
docker run --rm -it -v $(pwd):/src sonar:scanner
, substituting the path to your project for the$(pwd)
part if your source code isn't in the current directory.