Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1120 from JamesYongQiaoWang/enhanceReadMe
Browse files Browse the repository at this point in the history
Enhance the README to install swarm from source
  • Loading branch information
moxiegirl committed Aug 7, 2015
2 parents bf4bb80 + ef123b3 commit d647d82
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,52 @@ The goal is to provide a smooth out-of-the-box experience for simple use cases,
allow swapping in more powerful backends, like Mesos, for large scale production
deployments.

## Installation and documentation
## Installation for Swarm Users

Full documentation [is available here](http://docs.docker.com/swarm/).
For installing swarm for using in your environment, use the Docker Swarm
documentation on [docs.docker.com](http://docs.docker.com/swarm/).

## Development installation
## Installation for Swarm Developers

You can download and install from source instead of using the Docker
image. Ensure you have golang, godep and the git client installed.
Developers should always download and install from source rather than
using the Docker image.

**For example, on Ubuntu you'd run:**
### Prerequisites

```bash
$ apt-get install golang git
$ go get github.com/tools/godep
```
1. Beginning with Swarm 0.4 golang 1.4.x or later is required for building Swarm.
Refer to the [Go installation page](https://golang.org/doc/install#install)
to download and install the golang 1.4.x or later package.
> **Note**: On Ubuntu 14.04, the `apt-get` repositories install golang 1.2.1 version by
> default. So, do not use `apt-get` but install golang 1.4.x manually using the
> instructions provided on the Go site.
2. Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

You may need to set `$GOPATH`, e.g `mkdir ~/gocode; export GOPATH=~/gocode`.
3. Install [godep](https://github.com/tools/godep).

**For example, on Mac OS X you'd run:**
### Clone and build Swarm

> **Note** `GOPATH` should be set when install godep in above step.
Install the `swarm` binary in the `$GOPATH/bin` directory. An easy way to do this
is using the `go get` command.

```bash
$ brew install go
$ export GOPATH=~/go
$ export PATH=$PATH:~/go/bin
$ go get github.com/tools/godep
$ go get github.com/docker/swarm
```

Then install the `swarm` binary:
You can also do this manually using the following commands:

```bash
$ mkdir -p $GOPATH/src/github.com/docker/
$ cd $GOPATH/src/github.com/docker/
$ git clone https://github.com/docker/swarm
$ cd swarm
$ godep go install .
$ $GOPATH/bin/godep go install .
```

Then you can find the swarm binary under `$GOPATH/bin`.

From here, you can follow the instructions [in the main documentation](http://docs.docker.com/swarm/),
replacing `docker run swarm` with just `swarm`.

Expand Down

0 comments on commit d647d82

Please sign in to comment.