Skip to content

Commit

Permalink
docs: update info about building trivy-db in README.md (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen authored Dec 4, 2024
1 parent 333d808 commit dae35cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,22 @@ GLOBAL OPTIONS:
```

### Building the DB
You can utilize `make db-all` to build the database, the DB artifact is outputted to the assets folder.

Alternatively Docker is supported, you can run `docker build . -t trivy-db`.
To build trivy-db locally, you can use the following order of commands from the Makefile:
```bash
make db-fetch-langs db-fetch-vuln-list // To download all advisories and other required files (`./cache` dir by default)
make build // Build `trivy-db` binary
make db-build // Build database (`./out` dir by default)
make db-compact // Compact database (`./assets` dir by default)
make db-compress // Compress database into `db.tar.gz` file
```

If you want to build a trivy integration test DB, please run `make create-test-db`
To build trivy-db image and push into registry, you need to use [Oras CLI](https://oras.land/cli/).
For example for `ghcr`:
```bash
./oras push --artifact-type application/vnd.aquasec.trivy.config.v1+json \
"ghcr.io/aquasecurity/trivy-db:2" \
db.tar.gz:application/vnd.aquasec.trivy.db.layer.v1.tar+gzip
```

## Update interval
Trivy DB is built every 6 hours.
Expand Down

0 comments on commit dae35cc

Please sign in to comment.