Skip to content

Instantly share code, notes, and snippets.

@rubystream
Last active November 13, 2021 20:48
Show Gist options
  • Save rubystream/c844f44e568808e10822e58640d09dc2 to your computer and use it in GitHub Desktop.
Save rubystream/c844f44e568808e10822e58640d09dc2 to your computer and use it in GitHub Desktop.
Using ort - Docker vesion

How-To ort the Docker way

Purpose of this document is to provide instruction on how to create docker image for convenient way of running ORT tool in order to assess license compliance of project license compliance.

Creating the Docker image

To create the Docker image first the ORT project follow these steps:

  1. Clone ORT project to local folder
    git clone --recurse-submodules https://github.com/oss-review-toolkit/ort.git
  2. make the ort folder the current one:
    cd ort 
  3. build the docker image
    docker build -t ort .

Run using Docker

Once you have the docker image created you can run it using the following command:

docker run -v /workspace:/project ort --info analyze -f JSON -i /project -o /project/ort/analyzer

In the above command the docker volume monut parameter -v mounts the local folder /workspace to internal docker /project folder. Other commands are ort command parameters indicating the ort command analyze, output format -f JSON, input folder containing the project to assess -i /project and the destination for the output results -o /project/ort/analyser. It is essential to notice that output results folder MUST not exist.

To mount the current folder to dockers /project one use the following docker volume mount parameter -v $PWD/:/project.

To get ort help specific to the analyzer run this command:

docker run ort analyze --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment