sbom-action: sbom-action not working with docker-in-docker GitHub actions runner
I build a docker container using the docker/setup-buildx-action@v2.6.0 and docker/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.
- name: Generate SBOM
id: sbom
uses: anchore/sbom-action@v0
with:
image: "${{ inputs.registry }}/${{ inputs.image_name }}:${{ steps.image_date_tag.outputs.TAG_NAME }}"
gives the error (PII removed from container and repo names)
[0000] DEBUG no socket address was found. Trying default address: /run/user/1001/podman/podman.sock from-lib=stereoscope
[0000] DEBUG looking for socket file: stat /run/user/1001/podman/podman.sock: no such file or directory from-lib=stereoscope
[0000] DEBUG image: source=OciRegistry location=docker-local.my.artifactory.systems/gha-scaleset-runner:20230621-121746 from-lib=stereoscope
[0000] DEBUG pulling image info directly from registry image="docker-local.my.artifactory.systems/gha-scaleset-runner:2023062-[121](https://github.com/my_org/my_repo/actions/runs/5333937405/jobs/9665073233#step:13:122)746" from-lib=stereoscope
[0000] DEBUG no registry credentials configured, using the default keychain from-lib=stereoscope
2023/06/21 12:22:03 error during command execution: 1 error occurred:
* failed to construct source from user input "docker-local.my.artifactory.systems/gha-scaleset-runner:20230621-121746": could not fetch image "docker-local.my.artifactory.systems/gha-scaleset-runner:20230621-121746": unable to use OciRegistry source: failed to get image descriptor from registry: GET https://docker-local.my.artifactory.systems/v2/gha-scaleset-runner/manifests/20230621-121746: MANIFEST_UNKNOWN: The named manifest is not known to the registry.; map[manifest:gha-scaleset-runner/20230621-121746/manifest.json]
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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (11 by maintainers)
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
DOCKER_HOSTeven when its a tcp port instead of a local socket. Running the same command below with and withoutDOCKER_HOSTin the environment:So it looks like
DOCKER_HOSTis respected by syft correctly in this case. It seems like there are two possibilities: