Skip to content

--download-db-only doesn't work with the latest version of Trivy #6228

Closed Answered by DmitriyLewen
asprouse5 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @asprouse5
Thanks for your report.

$TRIVY_TEMP_DIR env is empty.
So Trivy takes image as cache dir:
Take a look this example:

FROM alpine

RUN apk add --update --no-cache curl
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -x -s -- -b /usr/local/bin

RUN export TRIVY_TEMP_DIR=$(mktemp -d)
RUN trivy --cache-dir $TRIVY_TEMP_DIR image image --download-db-only
➜  6228 docker build -t 6228 .                 
[+] Building 0.0s (9/9) FINISHED                                                docker:desktop-linux
 => [internal] load build definition from Dockerfile                                            0.0s
 => => transferring dockerfile: 3…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DmitriyLewen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
triage/support Indicates an issue that is a support question.
2 participants