From dbc07ba1748fa16eee83fffd4ee6f50891a62b3f Mon Sep 17 00:00:00 2001 From: lukemarsden Date: Sat, 3 Jan 2015 22:39:41 +0000 Subject: [PATCH 1/2] Clarify README * Make it easier for Go noobs like me to use `go get`. * Make it clearer that `$SWARM_TOKEN` should be dynamic. Signed-off-by: Luke Marsden --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4472529105..5ddb086fcb 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,11 @@ Like the other Docker projects, `swarm` follows the "batteries included but remo ### Installation ######1 - Download and install the current source code. +Ensure you have golang installed (e.g. `apt-get install golang` on Ubuntu). +You may need to set `$GOPATH`, e.g `mkdir ~/gocode; export GOPATH=~/gocode`. + +The install `swarm` binary to your `$GOPATH` directory. + ```sh go get -u github.com/docker/swarm ``` @@ -25,16 +30,16 @@ This can be achieved by starting Docker with the `-H` flag (e.g. `-H 0.0.0.0:237 ```bash # create a cluster -$ swarm create +$ SWARM_TOKEN=`swarm create`; echo $SWARM_TOKEN 6856663cdefdec325839a4b7e1de38e8 # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery token://6856663cdefdec325839a4b7e1de38e8 --addr= +$ swarm join --discovery token://$SWARM_TOKEN --addr= # start the manager on any machine or your laptop -$ swarm manage --discovery token://6856663cdefdec325839a4b7e1de38e8 -H= +$ swarm manage --discovery token://$SWARM_TOKEN -H= # use the regular docker cli $ docker -H info @@ -44,7 +49,7 @@ $ docker -H logs ... ... # list nodes in your cluster -$ swarm list --discovery token://6856663cdefdec325839a4b7e1de38e8 +$ swarm list --discovery token://$SWARM_TOKEN http:// ``` @@ -88,4 +93,3 @@ We welcome pull requests and patches; come say hi on IRC, #docker-swarm on freen Code and documentation copyright 2014 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons. - From dc393390dab92ec52f26137ded20918f54d78c02 Mon Sep 17 00:00:00 2001 From: Luke Marsden Date: Mon, 5 Jan 2015 10:20:23 +0000 Subject: [PATCH 2/2] Make clear that you must manually interpolate token. Signed-off-by: Luke Marsden --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5ddb086fcb..e8df1bb30d 100644 --- a/README.md +++ b/README.md @@ -30,26 +30,26 @@ This can be achieved by starting Docker with the `-H` flag (e.g. `-H 0.0.0.0:237 ```bash # create a cluster -$ SWARM_TOKEN=`swarm create`; echo $SWARM_TOKEN -6856663cdefdec325839a4b7e1de38e8 +$ swarm create +6856663cdefdec325839a4b7e1de38e8 # <- this is your unique # on each of your nodes, start the swarm agent # doesn't have to be public (eg. 192.168.0.X), # as long as the other nodes can reach it, it is fine. -$ swarm join --discovery token://$SWARM_TOKEN --addr= +$ swarm join --discovery token:// --addr= # start the manager on any machine or your laptop -$ swarm manage --discovery token://$SWARM_TOKEN -H= +$ swarm manage --discovery token:// -H= # use the regular docker cli $ docker -H info -$ docker -H run ... -$ docker -H ps +$ docker -H run ... +$ docker -H ps $ docker -H logs ... ... # list nodes in your cluster -$ swarm list --discovery token://$SWARM_TOKEN +$ swarm list --discovery token:// http:// ```