aquasecurity / trivy-db

Apache License 2.0
215 stars 131 forks source link

running trivy with docker in air gapped environment gives me cannot skip downloading DB for the first time #395

Closed johnqa closed 5 months ago

johnqa commented 5 months ago

I have to run trivy in an offline environment using the docker image.

I copied the trivy db to a certain location and mapped it to the container, but I am getting the error:

ERROR   The first run cannot skip downloading DB
FATAL   init error: DB error: database error: --skip-update cannot be specified on the first run

The command is:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "/home/user/k8s:/tmp" -v /home/user/trivy-db/:/root/.cache/trivy aquasec/trivy:0.50.0 k8s pods  -n default --report=all --kubeconfig /tmp/config --skip-db-update --skip-java-db-update --offline-scan

What can be the issue and how can I solve it?

Thank you, John