Commit d8bf794d authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

docs: document how to run as a container

parent aefdeecb
Loading
Loading
Loading
Loading
Loading
+27 −2
Original line number Diff line number Diff line
@@ -2,15 +2,40 @@

This project provides a CLI tool able to publish SBOM files to a [Dependency Track](https://docs.dependencytrack.org/) server.

## Install
## Get started

`sbom-scanner` requires Python 3.11 or higher and can be installed with the following command:
### Run SBOM Scanner CLI as a Python program

`sbom-scanner` is a Python program and can be installed as a PyPI package. It requires Python 3.11 or higher and can be installed with the following command:

```bash
# install from GitLab PyPI packages
pip install sbom-scanner --index-url https://gitlab.com/api/v4/projects/to-be-continuous%2Ftools%2Fdt-sbom-scanner/packages/pypi/simple --upgrade

# obtain help
sbom-scanner --help

# run
sbom-scanner \
  --base-api-url http://localhost:8080/api \
  --api-key "$DT_API_KEY" \
  --project-path "my-group/my-project/sub-{file_prefix}" \
  **/*.cyclonedx.json
```

### Run SBOM Scanner CLI as a container

`sbom-scanner` can also be run as a container image using Docker or Podman.

```bash
# run from GitLab Container Registry
docker run \
  --rm --volume $(pwd):/code --env DEPTRACK_API_KEY \
  registry.gitlab.com/to-be-continuous/tools/dt-sbom-scanner:latest \
  --base-api-url http://host.docker.internal:8080/api \
  --api-key "$DT_API_KEY" \
  --project-path "my-group/my-project/sub-{file_prefix}" \
  **/*.cyclonedx.json
```

## Usage