Skip to content

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

@wagoodman

Description

@wagoodman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions