Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error extension Cannot connect to the Docker daemon at unix:///var/run/docker.sock. #54

Open
jaysson1710 opened this issue Nov 14, 2023 · 8 comments

Comments

@jaysson1710
Copy link

Hi everyone
I am trying to use the trivy extension but I have this error when using the option "Run Trivy using the aquasec/trivy docker image" to analyze images

  • unable to inspect the image (****:latest): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I'm sure that docker is running, because I build an image in the previous step.

I would appreciate any help you can give me.

@gbrmcn1
Copy link

gbrmcn1 commented Dec 5, 2023

Getting the same issue on my end - looking in debug mode I extracted the command that the extension is trying to run.

Adding: -v /var/run/docker.sock:/var/run/docker.sock fixes this for me

@joewragg
Copy link

joewragg commented Dec 19, 2023

Can we fix this? There's no way to bind mount the docker socket currently?

Why doesn't the ADO task add this docker unix socker bind mount automatically as they recommend in the trivy docs: https://aquasecurity.github.io/trivy/v0.48/getting-started/installation/#use-container-image

@vzabawski
Copy link

vzabawski commented Dec 28, 2023

Getting the same issue on my end - looking in debug mode I extracted the command that the extension is trying to run.

Adding: -v /var/run/docker.sock:/var/run/docker.sock fixes this for me

Did you use custom Docker task for that intead of Trivy task?

@joewragg
Copy link

Getting the same issue on my end - looking in debug mode I extracted the command that the extension is trying to run.
Adding: -v /var/run/docker.sock:/var/run/docker.sock fixes this for me

Did you use custom Docker task for that intead of Trivy task?

I ended up writing a pipeline template to do it with the Bash action. This really should be fixed!

@georg-jung
Copy link

See also #57.
I forked this extension and publish a trivy-contrib task, which includes this fix als well as some others: https://marketplace.visualstudio.com/items?itemName=georg-jung.trivy-contrib.

@CzapoX
Copy link

CzapoX commented Feb 16, 2024

See also #57. I forked this extension and publish a trivy-contrib task, which includes this fix als well as some others: https://marketplace.visualstudio.com/items?itemName=georg-jung.trivy-contrib.

Hi @georg-jung, I am using your fork, thanks to which the task began to pass, however, I have no way to preview the results in the Trivy tab. I get infinite loading with no console errors, only in the network tab I see two looped requests (shown below). Would you be able to direct me how I could debug the extension and find the reason why the tab is not working so I can start working on Pull Request with a fix.

image

@georg-jung
Copy link

Thanks @CzapoX for creating the PR with the fix! Viewing the results works now. I also updated trivy to the latest version and added an option to skip e.g. secret scanning.

@joewragg
Copy link

joewragg commented Jul 9, 2024

Looks like it's been fixed and merged but no new version has been created of the task yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants