Skip to content

Commit d6389b2

Browse files
committed
Improve documentation regarding project outputs access from host
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 09af961 commit d6389b2

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

docs/command-line-interface.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@
33
Command Line Interface
44
======================
55

6-
A ``scanpipe`` command can be executed through the ``docker compose`` command line
7-
interface with::
6+
The ``scanpipe`` command can be executed using the Docker Compose command line interface.
7+
8+
If the Docker Compose stack is already running, you can execute the command as follows:
9+
10+
.. code-block:: shell
811
912
docker compose exec -it web scanpipe COMMAND
1013
11-
Alternatively, you can start a ``bash`` session in a new Docker container to execute
12-
multiple ``scanpipe`` commands::
14+
If the ScanCode.io services are not currently running, you can use the following command:
15+
16+
.. code-block:: shell
17+
18+
docker compose run --rm web scanpipe COMMAND
19+
20+
Additionally, you can start a new Docker container and execute multiple
21+
``scanpipe`` commands within a ``bash`` session:
22+
23+
.. code-block:: shell
1324
1425
docker compose run web bash
1526
scanpipe COMMAND
@@ -244,6 +255,8 @@ Optional arguments:
244255
compatible with the XLSX and CSV formats.
245256
It cannot be used when multiple formats are provided.
246257

258+
Refer to :ref:`Mount projects workspace <mount_projects_workspace_volume>` to access
259+
your outputs on the host machine when running with Docker.
247260

248261
`$ scanpipe archive-project --project PROJECT`
249262
----------------------------------------------

docs/output-files.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,28 @@ the output file format with the ``–-format`` option:
3030
``PROJECT``'s :guilabel:`output/` directory. By default, JSON output
3131
files are created when no file format is given.
3232

33+
.. _mount_projects_workspace_volume:
34+
35+
.. warning::
36+
When running with Docker, ensure that the output files workspace is assigned
37+
to a volume to be accessible on the host machine.
38+
39+
To add local input files to a project using the :ref:`command_line_interface`,
40+
additional arguments need to be passed to the ``docker compose`` command.
41+
42+
For example, using the following command will mount and make available the
43+
projects workspace on the host at ``~/projects/``:
44+
45+
.. code-block:: bash
46+
47+
mkdir ~/projects/
48+
docker compose run --volume ~/projects/:/var/scancodeio/workspace/projects/ \
49+
web scanpipe output --project my_project --format json
50+
51+
Alternatively, you can also locate the Docker volumes directory on your host
52+
machine. For instance, on Linux, it's typically found at:
53+
``/var/lib/docker/volumes/``.
54+
3355
Web UI
3456
^^^^^^
3557
When using the ScanCode.io web application, you can download the results of your

0 commit comments

Comments
 (0)