Trivy Scan Image from Within a Container
So I Am Having an Issue: I Have a Running Container of Jenkins Which Does Some Ci Steps I Downloaded on That Jenkins Container Trivy Inside It. in the Ci...
So I am having an issue:
- I have a running container of jenkins which does some CI steps
- I downloaded on that jenkins container trivy inside it.
- In the CI pipeline if I wish to scan a docker image with trivy it says:
FATAL scan error: image scan failed: failed analysis: analyze error: timeout: context deadline exceeded
OR
trivy image trivy:test
2023-01-27T13:45:57.711Z INFO Need to update DB
2023-01-27T13:45:57.711Z INFO Downloading DB...
31.14 MiB / 31.14 MiB [----------] 100.00% 1.70 MiB p/s 18s
and than stuck after that
I diagnosed the problem like that - the docker images are stored on my pc and the steps I'm running in my CI pipeline is commands that are being executed from withing my jenkins container and trivy does not recognises the image from outside the jenkins container.
so again - How the command trivy image test:test which runs from inside the jenkins container can have access to my local docker images?
Help will be appreciated:)
1 Answer
Try to use --timeout argument and see if it works.