From 861a7e02b623942cb92c5e6a5b784e321917a847 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Wed, 25 May 2016 12:14:01 -0400 Subject: [PATCH 1/3] Replace `tail -n +5` with appropriate sed `sed '1,/^$/d'` skips everything until the first empty line. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8c0cd3..f76d448 100644 --- a/README.md +++ b/README.md @@ -154,8 +154,8 @@ Dockviz also supports receiving Docker image or container json data on standard ``` $ curl -s http://localhost:4243/images/json?all=1 | dockviz images --tree $ curl -s http://localhost:4243/containers/json?all=1 | dockviz containers --dot | dot -Tpng -o containers.png -$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | tail -n +5 | dockviz images --tree -$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | tail -n +5 | dockviz containers --dot | dot -Tpng -o containers.png +$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | dockviz images --tree +$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | dockviz containers --dot | dot -Tpng -o containers.png ``` Note: GNU netcat doesn't support `-U` (UNIX socket) flag, so OpenBSD variant can be used. From ad9654ce576fe0fbd23fe6ec9eba23e656215cde Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Wed, 25 May 2016 12:18:35 -0400 Subject: [PATCH 2/3] Add example using Docker image without volume --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f76d448..2880422 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,8 @@ $ curl -s http://localhost:4243/images/json?all=1 | dockviz images --tree $ curl -s http://localhost:4243/containers/json?all=1 | dockviz containers --dot | dot -Tpng -o containers.png $ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | dockviz images --tree $ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | dockviz containers --dot | dot -Tpng -o containers.png +$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | docker run -i nate/dockviz images --tree +$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | docker run -i nate/dockviz containers --dot | dot -Tpng -o containers.png ``` Note: GNU netcat doesn't support `-U` (UNIX socket) flag, so OpenBSD variant can be used. From cd77167841cdc3d2a85ea23cd7afedddb5810ad7 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Wed, 25 May 2016 16:53:12 -0400 Subject: [PATCH 3/3] Don't fail if server returns CRLF --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2880422..eeb5f4e 100644 --- a/README.md +++ b/README.md @@ -154,10 +154,10 @@ Dockviz also supports receiving Docker image or container json data on standard ``` $ curl -s http://localhost:4243/images/json?all=1 | dockviz images --tree $ curl -s http://localhost:4243/containers/json?all=1 | dockviz containers --dot | dot -Tpng -o containers.png -$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | dockviz images --tree -$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | dockviz containers --dot | dot -Tpng -o containers.png -$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | docker run -i nate/dockviz images --tree -$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^$/d' | docker run -i nate/dockviz containers --dot | dot -Tpng -o containers.png +$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^[[:space:]]*$/d' | dockviz images --tree +$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^[[:space:]]*$/d' | dockviz containers --dot | dot -Tpng -o containers.png +$ echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^[[:space:]]*$/d' | docker run -i nate/dockviz images --tree +$ echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | sed '1,/^[[:space:]]*$/d' | docker run -i nate/dockviz containers --dot | dot -Tpng -o containers.png ``` Note: GNU netcat doesn't support `-U` (UNIX socket) flag, so OpenBSD variant can be used.