|
1 | 1 | Comprehensive Installation |
2 | 2 | ========================== |
3 | 3 |
|
4 | | -There are 3 main ways you can install ScanCode. |
| 4 | +There are 4 main ways you can install ScanCode. |
5 | 5 |
|
6 | 6 | - :ref:`app_install` |
7 | 7 |
|
8 | 8 | The recommended method for installing ScanCode is Downloading the latest release as an |
9 | 9 | application and then configure and use directly. This is easy because no knowledge of pip/git |
10 | 10 | or other developer tools is necessary. |
11 | 11 |
|
| 12 | +- :ref:`docker_install` |
| 13 | + |
| 14 | + An alternative to installing the latest Scancode Toolkit release natively is to build |
| 15 | + a Docker image from the included Dockerfile. This is easy because the only prerequisite |
| 16 | + is a working Docker installation. |
| 17 | + |
12 | 18 | - :ref:`source_code_install` |
13 | 19 |
|
14 | 20 | You can download/clone the source code repository via git/GitHub and then run a configure script |
@@ -234,6 +240,51 @@ Un-installation |
234 | 240 |
|
235 | 241 | ---- |
236 | 242 |
|
| 243 | +.. _docker_install: |
| 244 | + |
| 245 | +Installation via Docker: |
| 246 | +------------------------ |
| 247 | + |
| 248 | +You can install Scancode Toolkit by building a Docker image from the included Dockerfile. |
| 249 | + |
| 250 | +Download the ScanCode-Toolkit Source Code |
| 251 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 252 | + |
| 253 | +- Either download the Source Code for one of the releases ( :ref:`app_install` ) and unzip it. |
| 254 | +- Or git clone the latest ( :ref:`source_code_install` ) Source Code. |
| 255 | + |
| 256 | + |
| 257 | +Build the Docker image |
| 258 | +^^^^^^^^^^^^^^^^^^^^^^ |
| 259 | + |
| 260 | +The ``docker build`` command needs to run in the directory of the source code, |
| 261 | +make sure to ``cd`` into the correct directory. |
| 262 | + |
| 263 | + cd scancode-toolkit |
| 264 | + docker build -t scancode-toolkit . |
| 265 | + |
| 266 | +Run using Docker |
| 267 | +^^^^^^^^^^^^^^^^ |
| 268 | + |
| 269 | +The docker image will forward all arguments it receives directly to the ``scancode`` command. |
| 270 | + |
| 271 | +Display help: |
| 272 | + |
| 273 | + docker run scancode-toolkit --help |
| 274 | + |
| 275 | +Mount current working directory and run scan on mounted folder: |
| 276 | + |
| 277 | + docker run -v $PWD/:/project scancode-toolkit -clpeui --json-pp /project/result.json /project |
| 278 | + |
| 279 | +This will mount your current working from the host into ``/project`` in the container |
| 280 | +and then scan the contents. The output ``result.json`` will be written back to your |
| 281 | +corrent working directory on the host. |
| 282 | + |
| 283 | +Note that the parameters *before* ``scancode-toolkit`` are used for docker, |
| 284 | +those after will be forwarded to scancode. |
| 285 | + |
| 286 | +---- |
| 287 | + |
237 | 288 | .. _source_code_install: |
238 | 289 |
|
239 | 290 | Installation from Source Code: Git Clone |
|
0 commit comments