Run Trivy from docker on Mac

Official documentation:

On zsh terminal on a mac

Just run the image and pass the trivy commands as documented. To get version:

docker run aquasec/trivy version

Scan code from local file system

docker run -v /host/src/to/scan:/target aquasec/trivy --debug fs /target > trivy-output-report.txt

File trivy-output-report.txt is created in the host folder where running.

Documentation for local file system scan

Scan code from repo

As per documentation, only public repositories are supported (

docker run aquasec/trivy repo REPO_URL

Scan local .NET repo

In .NET, Trivy uses packages.config and *.deps.json. Since we don’t use packages.config (we use ), we need to build the solution to generate the PROJECT.deps.json in the bin folder. (Also, for this reason the remote scan probably would not work for our .NET solutions?)

git clone
dotnet build SRC/SOLUTION.sln
docker run -v /HOST/SRC:/target aquasec/trivy --debug fs /target > trivy-output-report.txt