From 87a4dee7ea93541a3d1639e201e64c125944d295 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 Sep 2014 16:32:19 +0100 Subject: [PATCH 1/5] Added 'weave version' command per Issue #56 --- weaver/weave | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/weaver/weave b/weaver/weave index 5dab5d9b..cbca4a80 100755 --- a/weaver/weave +++ b/weaver/weave @@ -8,6 +8,7 @@ usage() { echo "weave expose /" echo "weave hide /" echo "weave status" + echo "weave version" echo "weave stop" exit 1 } @@ -122,6 +123,17 @@ case "$COMMAND" in fi exit 0 ;; + version) + # Try the running container first; if no luck try the image + if ! DOCKERIMAGE=$(docker inspect --format='{{ .Image }}' weave 2>/dev/null) ; then + if ! DOCKERIMAGE=$(docker inspect --format='{{ .Id }}' zettio/weave 2>/dev/null) ; then + echo "Unable to find zettio/weave image." >&2 + exit 1 + fi + fi + docker images --no-trunc | grep $DOCKERIMAGE | grep -v latest | tr -s ' ' | cut -d ' ' -f 2 + exit 0 + ;; run) [ $# -gt 0 ] || usage IPADDR=$1 From dbe725b8ac6251e8331c7ca3d41083a63323a61e Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 Sep 2014 16:40:17 +0100 Subject: [PATCH 2/5] Add 'weave version' to the README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3cf56309..0a6304bd 100644 --- a/README.md +++ b/README.md @@ -349,6 +349,13 @@ quickly enough. ## Troubleshooting +Check what version of weave you are running: + + weave version + +and compare against https://registry.hub.docker.com/u/zettio/weave/tags/manage/ +to ensure you have the latest released version. + Check the weave container logs with docker logs weave From 0732968ed03c3ecf0db562729e0fde4f0db6c818 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 Sep 2014 16:44:12 +0100 Subject: [PATCH 3/5] Add instructions to fetch the latest image --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a6304bd..80132fbe 100644 --- a/README.md +++ b/README.md @@ -353,8 +353,10 @@ Check what version of weave you are running: weave version -and compare against https://registry.hub.docker.com/u/zettio/weave/tags/manage/ -to ensure you have the latest released version. +and compare against https://registry.hub.docker.com/u/zettio/weave/tags/manage/. +If you don't have the latest released version you can download it with: + + docker pull zettio/weave Check the weave container logs with From 66b28593b25644425ee4036d63063558c045ac50 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 Sep 2014 16:48:12 +0100 Subject: [PATCH 4/5] Fix indenting --- weaver/weave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weaver/weave b/weaver/weave index cbca4a80..790af052 100755 --- a/weaver/weave +++ b/weaver/weave @@ -124,7 +124,7 @@ case "$COMMAND" in exit 0 ;; version) - # Try the running container first; if no luck try the image + # Try the running container first; if no luck try the image if ! DOCKERIMAGE=$(docker inspect --format='{{ .Image }}' weave 2>/dev/null) ; then if ! DOCKERIMAGE=$(docker inspect --format='{{ .Id }}' zettio/weave 2>/dev/null) ; then echo "Unable to find zettio/weave image." >&2 From 81ad24b10fa5938809807566879fb373a28bb424 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 15 Sep 2014 16:50:50 +0100 Subject: [PATCH 5/5] Don't need 'exit 0' any more --- weaver/weave | 1 - 1 file changed, 1 deletion(-) diff --git a/weaver/weave b/weaver/weave index c1c8dbc0..77a28173 100755 --- a/weaver/weave +++ b/weaver/weave @@ -195,7 +195,6 @@ case "$COMMAND" in fi fi docker images --no-trunc | grep $DOCKERIMAGE | grep -v latest | tr -s ' ' | cut -d ' ' -f 2 - exit 0 ;; run) [ $# -gt 0 ] || usage