From 16075245dd5ee091b4bad183b0f0f934726460db Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 13 Jun 2016 20:48:21 -0700 Subject: [PATCH] fix embedded docker run instructions, add selinux help closes #17 --- containers.go | 2 +- help.go | 12 ++++++++++++ images.go | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/containers.go b/containers.go index a115009..4a19997 100644 --- a/containers.go +++ b/containers.go @@ -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 \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 \nFor more help, run 'dockviz help'") } else { return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err) } diff --git a/help.go b/help.go index 6dae6f9..e3f7db5 100644 --- a/help.go +++ b/help.go @@ -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 diff --git a/images.go b/images.go index 196f36f..fa2e988 100644 --- a/images.go +++ b/images.go @@ -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 \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 \nFor more help, run 'dockviz help'") } else { return fmt.Errorf("Unable to connect: %s\nFor help, run 'dockviz help'", err) }