Qodana 2021.1 Help

Docker Image Paths and Configuration Options

Docker image paths

  • /data/project  — root directory of the project to be analyzed

  • /data/results  — directory to store the analysis results, needs to be empty before each Qodana run

Configuration

Available arguments:

$ docker run jetbrains/qodana-license-audit Usage: entrypoint [OPTIONS] Application & help options: -i, --project-dir PATH Project folder to inspect (default: /data/project) -o, --results-dir PATH Save results to the folder (default: /data/results) -r, --report-dir PATH Save HTML report to the folder (default: /data/results/report) -s, --save-report Generate an HTML report -w, --show-report Serve an HTML report -h, --host STRING Specify host to serve UI at (default: localhost) -p, --port INTEGER Specify port to serve UI on (default: 8080)

Examples of execution tuneup

  • Display a report in HTML. After the License Audit analysis is finished, the container will not exit and will listen to port 8080. You can connect to http://localhost:8080 to see the results. When done, you can stop the webserver by pressing Ctrl-C in the Docker console.

docker run ... -p 8080:8080 <image-name> --show-report

Specify tools versions required by your project

The default installed versions of tools (languages SDKs or build systems) in the License Audit image are:

JAVA_VERSION="11.0.11.hs-adpt" KOTLIN_VERSION="1.5.10" GRADLE_VERSION="6.8.3" PHP_VERSION="7.4.16" PYTHON_VERSION="3.8.10" NODE_VERSION="15.7.0"

If your project requires another tool version, pass the environment variable with the tool's name and its version to docker run:

docker run --rm -it -p 8080:8080 \ -v /project/:/data/project \ -v /results/:/data/results \ -e PYTHON_VERSION=3.7.10 \ jetbrains/qodana-license-audit:latest --show-report

Then it will be installed on the container launch and used to obtain dependencies.

Find available tools versions

Run the command to find available versions for the wanted tool

docker run --rm -it jetbrains/qodana-license-audit:latest list <tool>

where tool is a tool name, which can be java, kotlin, gradle, php, python or node.

Known issues with Gradle projects

  1. If your project has no Gradle Wrapper included and requires a Gradle version other than the default 6.8.3, set the GRADLE_VERSION image environment variable:

docker run --rm -it -p 8080:8080 \ -v /project/:/data/project \ -v /results/:/data/results \ -e GRADLE_VERSION=5.6.1 jetbrains/qodana-license-audit:latest --show-report
  1. In case of the error Could not find or load main class org.gradle.wrapper.GradleWrapperMain, push the Gradle Wrapper to the project repository.

Run as non-root

By default, the container is run as the root user so that Qodana can read any volumes bind-mounted with the project and write the results. As a result, files in the results/ folder are owned by the root after the run.
To avoid this, you can run the container as a regular user:

docker run -u $UID ... # or docker run -u $(id -u):$(id -g) ...

Note that in this case, the results/ folder on the host should already be created and owned by you. Otherwise, Docker will create it as root, and Qodana will not be able to write to it.

Turn off user statistics

To disable the reporting of usage statistics, add the DISABLE_STAT_COLLECTION environment variable:

docker run -e DISABLE_STAT_COLLECTION=true <image-name>
Last modified: 11 July 2021