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

Odd error message when docker.socket in home dir is used #177

Open
wagoodman opened this issue May 5, 2023 · 0 comments
Open

Odd error message when docker.socket in home dir is used #177

wagoodman opened this issue May 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@wagoodman
Copy link
Contributor

What happened:
In later versions of docker desktop the default docker socket appears to be in ~/.docker/run instead of at /var/run/docker.sock. (Docker desktop settings > Advanced > uncheck enable "default docker socket"). Even when the symlink from /var/run/docker.sock to the alternative location is missing the docker CLI works fine, however syft fails with:

$ syft docker:alpine:latest

[0000]  WARN scheme "docker" specified, but it coincides with a common image name; re-examining user input "docker:alpine:latest" without scheme parsing because image retrieval using scheme parsing 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? from-lib=syft
error: 1 error occurred:
	* unable to analyze image: unable to make new source: could not fetch image "alpine:latest": unable to determine image source to select platform

What you expected to happen:

  • The error message should be clear that you specified docker but the docker daemon was not accessible... we shouldn't try to keep going any further down this path. (This might not be possible lexically, so this is a soft ask).
  • The unknown source type isn't in the setPlatform switch case which is why this fails, could we make this pass this switch and fail on the pull?
  • Syft should have worked by falling back to the home dir socket! What mechanisms are in place for the docker CLI where this works for them but not us? (note: DOCKER_HOST is not at play here).

Note: The behavior is described from syft's point of view, but this is a stereoscope concern.

@wagoodman wagoodman added the bug Something isn't working label May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant