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 the Qodana run
/root/.config/idea -- idea configuration directory
/opt/idea -- directory of the idea distributive
/data/profile.xml -- used if a profile wasn't configured by run options or via
qodana.yaml. See Order of resolving profile.
Examples of execution tuneup:
Override the default inspection profile:docker run ... -v <inspection-profile.xml>:/data/profile.xml <image-name>
Save a report in HTML. By default, the HTML report will be stored in a separate
report/subdirectory under the
resultsdirectory. This location could be configured with
--report-dir.docker run ... <image-name> --save-report
Display a report in HTML. After the inspection is finished, the container will not exit and will listen to port
8080. You can connect to
http://localhost:8080to see the results. When done, you can stop the web server by pressing
Ctrl-Cin the Docker console.docker run ... -p 8080:8080 <image-name> --show-report
Extra Gradle settings:docker run ... -v <source-directory>/gradle.properties:/root/.gradle/gradle.properties <image-name>
Change the Heap size (default is 80% of host RAM):docker run ... -e _JAVA_OPTIONS=-Xmx6g <image-name>
Log INFO messages to STDOUT. By default, the log level for STDOUT is WARN.docker run ... -e IDE_PROPERTIES_PROPERTY='-Didea.log.config.file=info.xml' <image-name>
idea.propertiesfile:docker run ... -e IDEA_PROPERTIES=/data/project/idea.properties <image-name>
Order of resolving profile
Qodana checks the configuration parameters for resolving the inspection profile in this order:
Profile with the name
%name%from the command line option
Profile by the path
%path%from the command line option
Profile with the name
Profile by the path
Profile mounted to
Fall back to using the embedded
The Qodana image contains selected Idea Ultimate plugins + PHP plugin.
Paid plugins are not yet supported. Each vendor must clarify licensing terms for CI usage and collaborate with us to make it work.
You can add any free IntellJ platform plugins or your custom plugin using the following command:
To optimize the most common cases, some bundled plugins are disabled by default. You can check the whole list of disabled plugins in
By default are enabled: Java, Kotlin for Server Side, PHP, and their libraries/frameworks' plugins. Gradle and Maven plugins are also enabled.
To change the plugins list, do any of the following:
disabled_plugins.txtby mounting your own file:docker run ... -v $empty_file$:/root/.config/idea/disabled_plugins.txt <image-name>
Use IDE properties
ordocker run ... -e IDE_PROPERTIES_PROPERTY=' -Didea.suppressed.plugins.id=com.intellij.spring.security' <image-name>
Qodana allows checking only changed files:
You can adjust the
idea.required.plugins.id value and keep only the CVS plugin suitable for your project.
Run as non-root
By default, the container runs as
root user, so Qodana would be able to read any bind-mounted volumes with the project and write the results. Which also leads to files in
results/ folder owned by
root after the run.
To avoid this, you can run container as a current user:
Note that in this case, the
results/ folder on host should already be created and owned by you. Otherwise, Docker will create it as
root and Qodana will be unable to write to it.
You can decrease the time for Qodana run by persisting cache from one run to another. For example, package and dependency management tools such as Maven, Gradle, npm, and Yarn keep a local cache of downloaded dependencies.
By default, Qodana would save caches to folder
/data/cache inside container. This location could be changed via
--cache-dir cli argument. The data inside is per-repository, so you can pass cache from
branch-a to build checking
branch-b. In this case, only new dependencies would be downloaded, if they were added. The cache feature is available starting from
Example for local run:
docker run --rm -it -p 8080:8080 \ -v <source-directory>/:/data/project/ \ -v <output-directory>/:/data/results/ \ -v <cache-directory>/:/data/cache/ \ jetbrains/qodana --show-report
In this case mapping the same
<cache-directory> would speedup second run.
Turn off user statistics
To disable the reporting of usage statistics, adjust the