mirror of https://github.com/docker/docs.git
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 <luke@clusterhq.com>
This commit is contained in:
parent
d27e8a35a1
commit
dbc07ba174
14
README.md
14
README.md
|
|
@ -11,6 +11,11 @@ Like the other Docker projects, `swarm` follows the "batteries included but remo
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
######1 - Download and install the current source code.
|
######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
|
```sh
|
||||||
go get -u github.com/docker/swarm
|
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
|
```bash
|
||||||
# create a cluster
|
# create a cluster
|
||||||
$ swarm create
|
$ SWARM_TOKEN=`swarm create`; echo $SWARM_TOKEN
|
||||||
6856663cdefdec325839a4b7e1de38e8
|
6856663cdefdec325839a4b7e1de38e8
|
||||||
|
|
||||||
# on each of your nodes, start the swarm agent
|
# on each of your nodes, start the swarm agent
|
||||||
# <node_ip> doesn't have to be public (eg. 192.168.0.X),
|
# <node_ip> doesn't have to be public (eg. 192.168.0.X),
|
||||||
# as long as the other nodes can reach it, it is fine.
|
# as long as the other nodes can reach it, it is fine.
|
||||||
$ swarm join --discovery token://6856663cdefdec325839a4b7e1de38e8 --addr=<node_ip:2375>
|
$ swarm join --discovery token://$SWARM_TOKEN --addr=<node_ip:2375>
|
||||||
|
|
||||||
# start the manager on any machine or your laptop
|
# start the manager on any machine or your laptop
|
||||||
$ swarm manage --discovery token://6856663cdefdec325839a4b7e1de38e8 -H=<swarm_ip:swarm_port>
|
$ swarm manage --discovery token://$SWARM_TOKEN -H=<swarm_ip:swarm_port>
|
||||||
|
|
||||||
# use the regular docker cli
|
# use the regular docker cli
|
||||||
$ docker -H <swarm_ip:swarm_port> info
|
$ docker -H <swarm_ip:swarm_port> info
|
||||||
|
|
@ -44,7 +49,7 @@ $ docker -H <swarm_ip:swarm_port> logs ...
|
||||||
...
|
...
|
||||||
|
|
||||||
# list nodes in your cluster
|
# list nodes in your cluster
|
||||||
$ swarm list --discovery token://6856663cdefdec325839a4b7e1de38e8
|
$ swarm list --discovery token://$SWARM_TOKEN
|
||||||
http://<node_ip:2375>
|
http://<node_ip:2375>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -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.
|
Code and documentation copyright 2014 Docker, inc. Code released under the Apache 2.0 license.
|
||||||
Docs released under Creative commons.
|
Docs released under Creative commons.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue