Giter Site home page Giter Site logo

Crash when Docker isn't started about dive HOT 5 CLOSED

wagoodman avatar wagoodman commented on May 20, 2024 1
Crash when Docker isn't started

from dive.

Comments (5)

AnthonyMastrean avatar AnthonyMastrean commented on May 20, 2024 2

Runs on Windows with the right command. See #67 (comment)

from dive.

wagoodman avatar wagoodman commented on May 20, 2024 1

This bombs a bit more gracefully with the fix in 7d86809 (targeted for the v0.3.0 release):

$ docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_API_VERSION=1.37  wagoodman/dive:latest alpine:3.8
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

or

$ dive build -t dive-test:latest -f .data/Dockerfile .
Using config file: /home/wagoodman/.dive.yaml
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Don't have windows handy to try it out on, but I think it should behave similarly.

from dive.

MikhailTymchukDX avatar MikhailTymchukDX commented on May 20, 2024

I have slightly different case. When I try to pass an ID of an image to the dive, it crashes with similar error.
Docker for Windows, Linux containers:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive:latest fd6923b77f00

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(0x7ffed971df77, 0xc, 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, 0xc420299c00, 0x1, 0x1)
        /home/wagoodman/go/src/github.com/wagoodman/dive/cmd/analyze.go:36 +0x119
github.com/spf13/cobra.(*Command).execute(0xc651a0, 0xc42000c070, 0x1, 0x1, 0xc651a0, 0xc42000c070)
        /home/wagoodman/go/src/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0xc651a0, 0x2, 0x7fa5436ad000, 0x0)
        /home/wagoodman/go/src/github.com/spf13/cobra/command.go:852 +0x30a
github.com/spf13/cobra.(*Command).Execute(0xc651a0, 0xc4201b5f78, 0xc4201b5f58)
        /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

Omitting the ID prints help:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive:latest

No image argument given
This tool provides a way to discover and explore the contents of a docker image. Additionally the tool estimates
the amount of wasted space and identifies the offending files from the image.

Usage:
  dive [IMAGE] [flags]
  dive [command]

Available Commands:
  build       Builds and analyzes a docker image from a Dockerfile (this is a thin wrapper for the `docker build` command).
  help        Help about any command
  version     print the version number and exit (also --version)

Flags:
      --config string   config file (default is $HOME/.dive.yaml, ~/.config/dive.yaml, or $XDG_CONFIG_HOME/dive.yaml)
  -h, --help            help for dive
  -v, --version         display version number

Use "dive [command] --help" for more information about a command.

from dive.

wagoodman avatar wagoodman commented on May 20, 2024

@oscar-b putting in a simple check to exit more gracefully would be an easy thing to add, thanks.

@mickdekkers this is a different problem: it bombs while looking up the docker version since the docker client binary is not included in the image. This should also fail more gracefully (or guess a version to use, then fail gracefully if that doesn't work)

from dive.

MikhailTymchukDX avatar MikhailTymchukDX commented on May 20, 2024

@wagoodman Sorry, but i don't understand the underlying problem :(
One need to include the docker client binary, but this can not be done for Windows, according to the sample syntax in readme,
If it's possible, could you please provide a syntax to run the dive correctly in my case?

from dive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.