diff --git a/README.md b/README.md index a2fb8a7130..c928651101 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,28 @@ in more powerful backends, like `Mesos`, for large scale production deployments. ## Installation -###1 - Download and install the current source code. +###1 - Docker image. +The easiest way to get started with Swarm is to use the +[official Docker image](https://registry.hub.docker.com/_/swarm/). + +```sh +docker pull swarm +``` + +###2 - Alternative: Download and install from source. +Alternatively, you can download and install from source instead of using the +Docker image. + Ensure you have golang and git client installed (e.g. `apt-get install golang git` on Ubuntu). You may need to set `$GOPATH`, e.g `mkdir ~/gocode; export GOPATH=~/gocode`. The install `swarm` binary to your `$GOPATH` directory. -```sh +```bash go get -u github.com/docker/swarm ``` -###2 - Nodes setup +###3 - Nodes setup The only requirement for Swarm nodes is to run a regular Docker daemon (version `1.4.0` and later). @@ -39,16 +50,16 @@ network interface. This can be achieved by starting Docker with the `-H` flag ```bash # create a cluster -$ swarm create +$ docker run --rm 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 swarm manager can access it. -$ swarm join --addr= token:// +$ docker run -d swarm join --addr= token:// # start the manager on any machine or your laptop -$ swarm manage -H tcp:// token:// +$ docker run -t -p 2375: -t swarm manage token:// # use the regular docker cli $ docker -H tcp:// info @@ -58,7 +69,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list token:// +$ docker run --rm swarm list token:// ``` diff --git a/userguide.md b/userguide.md index a20e5a2e9f..4e0e5a7144 100644 --- a/userguide.md +++ b/userguide.md @@ -26,18 +26,11 @@ in more powerful backends, like `Mesos`, for large scale production deployments. > Docker daemon (version `1.4.0` and later), configured to listen to a `tcp` > port that the Swarm manager can access. -Docker `swarm` is currently only available as a single go binary on Linux. Download -it from [the latest release](https://github.com/docker/swarm/releases/latest) page -on GitHub. +The easiest way to get started with Swarm is to use the +[official Docker image](https://registry.hub.docker.com/_/swarm/). -For example: - -``` - $ wget -O swarm https://github.com/docker/swarm/releases/download/v0.1.0-rc1/swarm-Linux-x86_64 - # OR - $ curl -SsL https://github.com/docker/swarm/releases/download/v0.1.0-rc1/swarm-Linux-x86_64 > swarm - $ chmod 755 swarm - $ sudo cp swarm /usr/local/bin +```bash +docker pull swarm ``` ## Nodes setup @@ -50,16 +43,16 @@ The following example uses the Docker Hub based `token` discovery service: ```bash # create a cluster -$ swarm create +$ docker run --rm swarm create 6856663cdefdec325839a4b7e1de38e8 # <- this is your unique -# For each of your nodes, start a swarm agent -# the Docker daemon doesn't have to be public (eg. 192.168.0.X), +# on each of your nodes, start the swarm agent +# doesn't have to be public (eg. 192.168.0.X), # as long as the swarm manager can access it. -$ swarm join --addr= token:// +$ docker run -d swarm join --addr= token:// # start the manager on any machine or your laptop -$ swarm manage -H tcp:// token:// +$ docker run -t -p 2375: -t swarm manage token:// # use the regular docker cli $ docker -H tcp:// info @@ -69,7 +62,7 @@ $ docker -H tcp:// logs ... ... # list nodes in your cluster -$ swarm list token:// +$ docker run --rm swarm list token:// ```