Cant scan local docker image using trivy

2.4k views Asked by At

I am trying to can for vulnerabilities using trivy on a local docker image, but i am getting this error.

docker run aquasec/trivy:0.28.0 image ansys/twindeployer/runtime-vnc:7005166

11s2022-05-19T22:22:02.519Z   FATAL   image scan error: scan error: unable to initialize a scanner: unable to initialize a docker scanner: 3 errors occurred:
    * unable to inspect the image (ansys/twindeployer/runtime-vnc:7005166): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
    * unable to initialize Podman client: no podman socket found: stat podman/podman.sock: no such file or directory
    * GET https://index.docker.io/v2/ansys/twindeployer/runtime-vnc/manifests/7005166: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:ansys/twindeployer/runtime-vnc Type:repository]]
1

There are 1 answers

0
lquitadamo On

There's a similar question for this problem here: Scanning local docker image for vulnerability using Trivy gives unauthorized

You have to change your command:

docker run  -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy:0.28.0 image ansys/twindeployer/runtime-vnc:7005166