fix embedded docker run instructions, add selinux help

closes #17
This commit is contained in:
Nate Jones 2016-06-13 20:48:21 -07:00
parent 5a116b8dff
commit 16075245dd
3 changed files with 14 additions and 2 deletions

View file

@ -58,7 +58,7 @@ func (x *ContainersCommand) Execute(args []string) error {
clientContainers, err := client.ListContainers(docker.ListContainersOptions{All: true})
if err != nil {
if in_docker := os.Getenv("IN_DOCKER"); len(in_docker) > 0 {
return fmt.Errorf("Unable to access Docker socket, please run like this:\n docker run --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz containers <args>\nFor more help, run 'dockviz help'")
return fmt.Errorf("Unable to access Docker socket, please run like this:\n docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz containers <args>\nFor more help, run 'dockviz help'")
} else {
return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err)
}

12
help.go
View file

@ -24,6 +24,18 @@ Dockviz supports connecting to the Docker daemon directly. It defaults to
Dockviz also supports receiving Docker image or container json data on standard
input: curl -s http://localhost:4243/images/json?all=1 | dockviz images --tree
Running inside a Docker image:
Dockviz can be run as a Docker image, like this:
$ docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz
If you get an error that Dockviz is unable to access the Docker socket, even
when specified, SELinux may be getting in the way. See this issue comment for
more information:
https://github.com/justone/dockviz/issues/12#issuecomment-186682489
Visualizing:
Dockviz can visualize both images and containers. For more information on the

View file

@ -89,7 +89,7 @@ func (x *ImagesCommand) Execute(args []string) error {
ver, err := getAPIVersion(client)
if err != nil {
if in_docker := os.Getenv("IN_DOCKER"); len(in_docker) > 0 {
return fmt.Errorf("Unable to access Docker socket, please run like this:\n docker run --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz images <args>\nFor more help, run 'dockviz help'")
return fmt.Errorf("Unable to access Docker socket, please run like this:\n docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz images <args>\nFor more help, run 'dockviz help'")
} else {
return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err)
}