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

Running on windows: "panic: exec: "docker": executable file not found in $PATH" #67

Closed
christian-laakmann opened this issue Nov 16, 2018 · 2 comments
Milestone

Comments

@christian-laakmann
Copy link

HI,

I am trying to run dive using the provided instructions for windows:

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive:latest <some:image>

This is the output:

Analyzing Image
panic: exec: "docker": executable file not found in $PATH

goroutine 1 [running]:
github.com/wagoodman/dive/utils.DiscoverDockerVersion(0x94e220, 0x0)
        /home/wagoodman/go/src/github.com/wagoodman/dive/utils/docker.go:42 +0x18d
github.com/wagoodman/dive/image.InitializeData(0x7ffcea2b3f34, 0x4f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/wagoodman/go/src/github.com/wagoodman/dive/image/image.go:202 +0xf2
github.com/wagoodman/dive/cmd.analyze(0xc651a0, 0xc4202b1be0, 0x1, 0x1)
        /home/wagoodman/go/src/github.com/wagoodman/dive/cmd/analyze.go:36 +0x119
github.com/spf13/cobra.(*Command).execute(0xc651a0, 0xc420094010, 0x1, 0x1, 0xc651a0, 0xc420094010)
        /home/wagoodman/go/src/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0xc651a0, 0x2, 0x7f88f39ef6c8, 0x0)
        /home/wagoodman/go/src/github.com/spf13/cobra/command.go:852 +0x30a
github.com/spf13/cobra.(*Command).Execute(0xc651a0, 0xc4201cdf78, 0xc4201cdf58)
        /home/wagoodman/go/src/github.com/spf13/cobra/command.go:800 +0x2b
github.com/wagoodman/dive/cmd.Execute()
        /home/wagoodman/go/src/github.com/wagoodman/dive/cmd/root.go:30 +0x2d
main.main()
        /home/wagoodman/go/src/github.com/wagoodman/dive/main.go:38 +0xad

Is there a workaround for windows?

@AnthonyMastrean
Copy link
Contributor

I had the same problem just tonight! I tried sharing the Windows docker binary, but that doesn't make much sense (as this image is some kind of Linux).

PS> docker run --rm -it `
>>     -v /var/run/docker.sock:/var/run/docker.sock `
>>     -v "$((Get-Command -Name docker).Source):/bin/docker" `
>>     wagoodman/dive alpine

So, I figured docker must be in the MobyLinuxVM that's running under-the-covers, right? Apparently the latest Docker for Windows can figure out when you want to pass a VM path vs. a Windows path (you previously had to use an extra forward slash to escape it or something).

PS> docker run --rm -it `
>>    -v /:/test `
>>    alpine find /test -name docker -type f
/test/user/local/bin/docker
...

OK, so it's in there, we can use it! This command worked on my machine!

PS> docker run --rm -it `
>>     -v /var/run/docker.sock:/var/run/docker.sock `
>>     -v /usr/local/bin/docker:/bin/docker `
>>     wagoodman/dive alpine

image

This was referenced Nov 17, 2018
@wagoodman
Copy link
Owner

@AnthonyMastrean thanks for taking a look at this, I don't have a windows box readily available so this is a huge help.

@wagoodman wagoodman added this to the v0.3.0 milestone Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants