docker run \
-v $PWD/:/project \ # Mount current working directory into /project to use as input.
ort --info analyze \
-c /project/ort/config.hocon \ # Use file from "<workingdirectory>/ort" as config.
analyze (...) # Insert further arguments for the command.
Note: The single forward slash /
between the environment variable $PWD
and the :
is required for PowerShell compatibility, as PowerShell otherwise interprets :
as part of the environment variable.
Some web proxies, such as from Blue Coat (Symantec) do not support TLSv1.3, which leads to errors when Docker tries to establish a connection through them. The following steps allow to force a specific TLS version to be used:
- Insert
ENV JAVA_OPTS="-Djdk.tls.client.protocols=TLSv1.2"
in the Dockerfile, below theFROM
line to force a specific TLS version. - Run the build again, it should succeed now.
To authenticate with a private Git repository, ORT uses the (semi)standardized .netrc
file. With the following steps, .netrc
can be used with Docker.
-
Create a
.netrc
file:machine <hostname> login <username> password <password>
For example:
machine github.com login mygituser password mypersonaltoken
Ensure that there are no additional spaces, newlines, tabs, or other whitespace characters after the hostname, username, or password. Some third-party tools would otherwise interpret these whitespace characters as part of the authentication string and cause authentication errors with some providers.
Note: If you receive any authentication errors, double-check this file. The format often shared online with the properties separated by newlines does not work with Docker images for ORT, as not all included third-party tools support this format.
-
Mount the
.netrc
into the home directory of the ORT Docker container. By default that is the/root
directory:docker run -v <workspace_path>:/project -v <netrc_folder_path>/.netrc:/root/.netrc ort --info scan (...)
Important: Ensure that the
.netrc
file has been created atnetrc_folder_path
before running the command, otherwise Docker will create a folder.netrc
inside the container, instead of mounting a single file.