Skip to content

Commit

Permalink
fix embedded docker run instructions, add selinux help
Browse files Browse the repository at this point in the history
closes #17
  • Loading branch information
justone committed Jun 14, 2016
1 parent 5a116b8 commit 1607524
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion containers.go
Expand Up @@ -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)
}
Expand Down
12 changes: 12 additions & 0 deletions help.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion images.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1607524

Please sign in to comment.