Replies: 18 comments 6 replies
-
Seems like your image doesn't exist in your local Docker daemon. Please make sure the image name and tag is correct. |
Beta Was this translation helpful? Give feedback.
-
Working here with a local image present (MacOS, Docker Desktop, Trivy)
|
Beta Was this translation helpful? Give feedback.
-
Works for me too. |
Beta Was this translation helpful? Give feedback.
-
Ok, I think I've got the same problem:
I can run
Is there a way to scan images by image id? In a forensic investigation of a live system, it would be a bad idea to modify the docker image metadata, as that would alter the evidence and could jeopardize the case. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I'm also interested in scanning the image using image id |
Beta Was this translation helpful? Give feedback.
-
This issue is stale because it has been labeled with inactivity. |
Beta Was this translation helpful? Give feedback.
-
I have built a named local image and I get:
Freshly brew updated trivy. |
Beta Was this translation helpful? Give feedback.
-
TL;DR You might have not exported the image to your local docker image cache. Without providing information on your exact setup used to build the images it's hard to tell (OS, do you use containerd, docker, buildx, which versions, etc.). Longer version Today I decided to include Trivy scan of docker images built for my project with GitHub Actions. Built images are local to the GitHub Actions runner host. I got (pretty much) the same error in my initial build:
Initially I thought it was because I used
This made sense -- I'm using docker buildx for building. So: I suggest verifying that your build image is visible to docker using |
Beta Was this translation helpful? Give feedback.
-
I have exactly the same issue, but no --load doesn't help. Trivy doesn't use the local version, but always tries to pull from docker hub: ❯ docker images | grep test
test latest c33738aa1932 4 minutes ago 744MB
❯ trivy i test
2023-01-11T15:50:41.776+0100 INFO Vulnerability scanning is enabled
2023-01-11T15:50:41.777+0100 INFO Secret scanning is enabled
2023-01-11T15:50:41.777+0100 INFO If your scanning is slow, please try '--security-checks vuln' to disable secret scanning
2023-01-11T15:50:41.777+0100 INFO Please see also https://aquasecurity.github.io/trivy/v0.36/docs/secret/scanning/#recommendation for faster secret detection
2023-01-11T15:50:43.258+0100 FATAL image scan error: scan error: unable to initialize a scanner: unable to initialize a docker scanner: 4 errors occurred:
* unable to inspect the image (test): 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
* containerd socket not found: /run/containerd/containerd.sock
* GET https://index.docker.io/v2/library/test/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/test Type:repository]] But testing a docker hub image works on the same machine, so clearly non of the other problems it considers are there. ❯ trivy --version |
Beta Was this translation helpful? Give feedback.
-
@autarchprinceps Your issue is different from others. Trivy can't connect to the Docker daemon. Do you have special
|
Beta Was this translation helpful? Give feedback.
-
On mac looks like you have to set the
|
Beta Was this translation helpful? Give feedback.
-
Yes, @revolunet 's answer worked for me: export DOCKER_HOST=unix:///$HOME/.docker/run/docker.sock |
Beta Was this translation helpful? Give feedback.
-
Using Trivy 0.47.0, both the Debian packages directly on an Ubuntu 22.04 machine, and the 0.47.0 tarball inside a container with a mounted
gave:
The image is built with the default docker builder and listed in
makes things work for me, both inside the container and directly on the machine. Not sure if it matters, but using the Docker 24.0.7 Debian packages from docker.com. |
Beta Was this translation helpful? Give feedback.
-
using using 'docker run aquasec/trivy image localhost:5000/zigbee2mqtt:1.35.1' gave...
but it works if I provide the IP address of host instead of localhost.
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Is there no way to run trivy on an image without first running a docker or podman daemon ??
|
Beta Was this translation helpful? Give feedback.
-
In my case I have multiple docker contexts, and trivy needs to be "shown" the correct one. So:
Then based on the selected context (marked with *) set DOCKER_HOST and run
|
Beta Was this translation helpful? Give feedback.
-
I am trying to use trivy to scan a image locally built in my desktop
I used the command trivy image <image_name> and got the below error
Beta Was this translation helpful? Give feedback.
All reactions