-
Notifications
You must be signed in to change notification settings - Fork 30
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
sbom-action not working with docker-in-docker GitHub actions runner #424
Comments
Hi @apr-1985, thanks for reporting this issue! Can you help me understand one thing: Is this a setup that previously worked, and stopped working, or is this a new setup? |
Thanks for the reply. The setup is kubernetes self hosted runners using the github scale set runners https://github.com/actions/actions-runner-controller As far as I am aware nothing has podman installed. Cheers Adam |
I think On my system, if I quit docker and run
So I think the debug output you're seeing is syft trying Docker, then falling back to Podman, then falling back to using its built-in OCI Registry client directly, then failing. It's definitely a little surprising that it doesn't mention |
Hi. The section of workflow is now
The test docker step is working and shows the images with the correct tags however the Syft Action fails with the podman error described above. I think the issue probably comes from the fact that the GitHub Scaleset implementation uses a Docker In Docker container inside the pod and the the Runner container uses DOCKER_HOST env var to ship all the docker commands off to that DinD container
This means there is no docker sock in the runner container so if the Sbom-Action is not respecting the DOCKER_HOST env var and just looking for Thanks for the help looking at this |
Thanks @apr-1985 for the detailed follow-up! I think you're right that something is off with stereoscope's handling of the DOCKER_HOST environment variable, looking at https://github.com/anchore/stereoscope/blob/cd49355d934e9e09339e0b690398afe7bd9f63f1/internal/docker/client.go#L19-L51 It looks like we special case host's that start with |
It looks like the client itself doesn't automatically respect the |
Hi, Apologies I have been away. |
Here is some testing I did after disabling the default docker socket on my laptops (the one at $ syft docker:busybox:latest
2023/07/10 11:54:40 error during command execution: 1 error occurred:
* failed to construct source from user input "docker:busybox:latest": could not
fetch image "busybox:latest": scheme "docker" specified; image retrieval
using scheme parsing (busybox:latest) was unsuccessful: unable to use
DockerDaemon source: unable to inspect existing image: Cannot connect to the
Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?;
image retrieval without scheme parsing (docker:busybox:latest) was
unsuccessful: unable to determine image source
$ DOCKER_HOST="unix://$HOME/.docker/run/docker.sock" syft docker:busybox:latest
✔ Loaded image
✔ Parsed image
✔ Cataloged packages [1 packages]
NAME VERSION TYPE
busybox 1.36.1 binary It looks like syft is already respecting |
@apr-1985 one thing you might try doing is explicitly specifying that - name: Generate SBOM
id: sbom
uses: anchore/sbom-action@v0
with:
image: docker:"${{ inputs.registry }}/${{ inputs.image_name }}:${{ steps.image_date_tag.outputs.TAG_NAME }}" (note |
Hi thanks for the update and the continued investigation.
|
Thanks for testing again and for the logs @apr-1985. I'll keep looking into this. |
So I've confirmed in a Linux VM (fedora running under lima in case that matters for some reason in the future) that syft is respecting
So it looks like
|
This is a strange one as the Env var is definitely set as I can run Docker commands (e.g. docker images #424 (comment)) in the Workflow and build my test container and push it to Artifactory. Does the Syft Action run in a container and the env var not being passed through? Or is it a JS action? |
This |
We are hitting this same issue in our env. Action not working w dind actions runner deployment. |
Thanks for the comment @jdagostino9188 and @apr-1985! I wonder, can this issue be reproduced just by running syft in docker-in-docker without involving GitHub actions? That would make it much easier to work on. I'll try to reproduce it that way when I get a chance, but if anyone else could try to reproduce the issue just by running syft with docker in docker, or any way to reproduce it locally in general, that would be a huge help. |
I have circled back round to this again. This can probably be closed. |
Thanks for following up, @apr-1985 ! Please let us know if the problem resurfaces! |
I build a docker container using the
docker/setup-buildx-action@v2.6.0
anddocker/build-push-action@v4.1.0
actions. But do not push the container to Artifactory at this point.The image is built and loaded into docker fine, however when I try to run this action it cannot find the image locally and appears to be looking for a podman sock rather than docker.
gives the error (PII removed from container and repo names)
I am not sure why it is looking for a podman socket when all the documentation refers to using docker and I cannot find a config option for this.
Thanks for the help.
The text was updated successfully, but these errors were encountered: