Return to Image List

sonar-scanner-cli-docker

sonar-scanner-cli-docker

SonarScanner CLI is the command line tool used with SonarQube to perform static code analysis on source code. This Docker image is not compatible with C/C#/C++/Objective-C projects.

See the official site for more information

This image is built by IBM to run on the IBM Z architecture and is not affiliated with any other community that provides a version of this image.


License

View license information here

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.


Versions

Use the pull string below for the version of this image you require.
4.8.0.2856 docker pull icr.io/ibmz/sonar-scanner-cli-docker@sha256:9473d8ab39c42e1fee0f7f3980f8a531ec76120d75406745b2cd52fd84d44a9d Vulnerability Report10-18-2023
4.7.0.2747 docker pull icr.io/ibmz/sonar-scanner-cli-docker@sha256:7496f957afbf575bfcb0bc7d83c36ffadb5f9d2e98c8a11ec7ad4eca5315ee5c Vulnerability Report10-18-2023
Version Pull String Security (IBM Cloud) Created

Usage Notes

Start a icr.io/ibmz/sonarqube:8.5.1.38104 container.

Wait about 40 seconds for SonarQube to be ready before attempting to perform static code analysis.

Create a Docker volume place your source code, and a sonar-project.properties file in the root directory of that volume.

docker volume namedvolume

Contents of sonar-project.properties

sonar.projectKey=arbitrary.project.key
sonar.projectName=name of your project
sonar.sources=/usr/src
sonar.language=Language the source code is written in
sonar.sourceEncoding=encoding (ie., UTF-8)>

Check that SonarQube is ready.

curl -u admin:admin http://[host/ip where sonarqube is running]:[port]/api/system/health

Example Results

Total    % Received % Xferd  Average Speed   Time    Time      Current
                             Dload  Upload   Total   Spent     Speed
100    30  100    30    0     0     41      0 --:--:-- --:--:--   41{"health":"GREEN","causes":[]}

Run SonarScanner CLI to perform static code analysis on your code.

docker run --rm \
-e SONAR_HOST_URL="http://[host/ip where sonarqube is running]:[port]" \
-v [namedvolume]:/usr/src \
icr.io/ibmz/sonar-scanner-cli-docker:[tag]