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

ggshield scan docker fails with missing path error when run from the Docker image #924

Open
cdupuis opened this issue Jun 27, 2024 · 5 comments
Labels
status:new This issue needs to be reviewed type:bug Something isn't working

Comments

@cdupuis
Copy link

cdupuis commented Jun 27, 2024

Environment

  • ggshield version: gitguardian/ggshield:latest
  • Operating system (Linux, macOS, Windows):
  • Operating system version:
  • Python version:

Describe the bug

I expect the following command to not fail:

❯ docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e GITGUARDIAN_API_KEY=${GITGUARDIAN_API_KEY} gitguardian/ggshield ggshield secret scan docker alpine
Saving docker image...
Error: [Errno 2] No such file or directory: 'docker'

Re-run the command with --verbose to get a stack trace.
@cdupuis cdupuis added status:new This issue needs to be reviewed type:bug Something isn't working labels Jun 27, 2024
@fnareoh
Copy link
Collaborator

fnareoh commented Jun 28, 2024

Hi, thank you for creating this issue.
I believe this is due to the docker command not being available inside your docker.
The error occurs when trying to run this command to download the docker image alpine, but we will improve the error by catching it and printing something more explicit. 😄

@cdupuis
Copy link
Author

cdupuis commented Jun 28, 2024

I believe this is due to the docker command not being available inside your docker.

This is your official Docker image, not my image. So shouldn't you add the Docker CLI to the ggshield image in that case to make this error disappear?

@fnareoh
Copy link
Collaborator

fnareoh commented Jun 28, 2024

Ah yes sorry I got confused, yes we will !

@cdupuis
Copy link
Author

cdupuis commented Jun 28, 2024

I can confirm that running ggshield from an image built from the following Dockerfile works as expected:

FROM gitguardian/ggshield:latest

RUN \
    apt-get update \
    && apt-get install -y --no-install-recommends ca-certificates curl gnupg \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* \
    && curl -fsSL https://get.docker.com | sh

@fnareoh
Copy link
Collaborator

fnareoh commented Jun 28, 2024

Thanks a lot 🙏 , I doubled checked and opened a PR. We will just wait for the return of @agateau-gg (our main maintainer, returning probably next Wednesday) to validate !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:new This issue needs to be reviewed type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants