Source repo for Docker's Documentation
Go to file
Victor Vieux eb88068f93 refactor code: move filter/ and strategy/ out of scheduler and create a simple
scheduler interface.

Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:20:37 -08:00
Godeps update dockerclient 2015-02-27 14:17:02 -08:00
api refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00
cluster update dockerclient 2015-02-27 14:17:02 -08:00
discovery add an index and go make some small tweaks 2015-02-26 11:19:14 +10:00
docs Add beta warning to docs 2015-02-26 10:54:50 +00:00
filter refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00
scheduler refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00
script docker-compose examples: Remove affinities. 2015-02-10 13:26:21 -08:00
state state: Store container ID in requested state. 2015-01-19 13:25:27 -08:00
strategy refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00
version add VERSION file 2015-02-03 01:53:01 +00:00
.gitignore improve locks 2014-11-18 23:04:11 +00:00
.godir update .godir 2014-11-18 21:47:00 +00:00
.travis.yml hack code to not error on go vet 2015-02-02 18:20:41 +00:00
CONTRIBUTING.md Add Contributing doc 2014-12-07 00:54:19 +00:00
Dockerfile Dockerfile: Set swarm to bind to all interfaces in container mode. 2015-02-02 18:44:22 -08:00
LICENSE use tcp:// in doc and update copyrights 2015-01-12 22:58:03 +00:00
README.md refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00
ROADMAP.md Update ROADMAP.md 2015-02-09 11:01:23 -08:00
flags.go refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00
help.go Use actual binary name instead of hardcoding it 2015-01-24 08:27:36 +00:00
join.go improve some logs 2015-01-26 23:41:56 +00:00
join_test.go allow hostnames in join 2015-01-16 01:47:38 +00:00
logo.png smaller logo 2014-12-03 11:47:55 +01:00
main.go add VERSION file 2015-02-03 01:53:01 +00:00
manage.go refactor code: move filter/ and strategy/ out of scheduler and create a simple 2015-02-27 14:20:37 -08:00

README.md

Swarm: a Docker-native clustering system Build Status

Docker Swarm Logo

Docker Swarm is native clustering for Docker. It turns a pool of Docker hosts into a single, virtual host.

Swarm serves the standard Docker API, so any tool which already communicates with a Docker daemon can use Swarm to transparently scale to multiple hosts: Dokku, Compose, Krane, Flynn, Deis, DockerUI, Shipyard, Drone, Jenkins... and, of course, the Docker client itself.

Like other Docker projects, Swarm follows the "batteries included but removable" principle. It ships with a simple scheduling backend out of the box, and as initial development settles, an API will develop to enable pluggable backends. The goal is to provide a smooth out-of-box experience for simple use cases, and allow swapping in more powerful backends, like Mesos, for large scale production deployments.

Installation

###1 - Docker image. The easiest way to get started with Swarm is to use the official Docker image.

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.

go get -u github.com/docker/swarm

###3 - Nodes setup The only requirement for Swarm nodes is to run a regular Docker daemon (version 1.4.0 and later).

In order for Swarm to be able to communicate with its nodes, they must bind on a network interface. This can be achieved by starting Docker with the -H flag (e.g. -H tcp://0.0.0.0:2375).

Example usage

# create a cluster
$ docker run --rm swarm create
6856663cdefdec325839a4b7e1de38e8 # <- this is your unique <cluster_id>

# on each of your nodes, start the swarm agent
#  <node_ip> doesn't have to be public (eg. 192.168.0.X),
#  as long as the swarm manager can access it.
$ docker run -d swarm join --addr=<node_ip:2375> token://<cluster_id>

# start the manager on any machine or your laptop
$ docker run -d -p <swarm_port>:2375 swarm manage token://<cluster_id>

# use the regular docker cli
$ docker -H tcp://<swarm_ip:swarm_port> info
$ docker -H tcp://<swarm_ip:swarm_port> run ...
$ docker -H tcp://<swarm_ip:swarm_port> ps
$ docker -H tcp://<swarm_ip:swarm_port> logs ...
...

# list nodes in your cluster
$ docker run --rm swarm list token://<cluster_id>
<node_ip:2375>

See here for more information about other discovery services.

Advanced Scheduling

See filters and strategies to learn more about advanced scheduling.

TLS

Swarm supports TLS authentication between the CLI and Swarm but also between Swarm and the Docker nodes.

In order to enable TLS, the same command line options as Docker can be specified:

swarm manage --tlsverify --tlscacert=<CACERT> --tlscert=<CERT> --tlskey=<KEY> [...]

Please refer to the Docker documentation for more information on how to set up TLS authentication on Docker and generating the certificates.

Note that Swarm certificates must be generated withextendedKeyUsage = clientAuth,serverAuth.

Participating

We welcome pull requests and patches; come say hi on IRC, #docker-swarm on freenode.

Creators

Andrea Luzzardi

Victor Vieux

Code and documentation copyright 2014-2015 Docker, inc. Code released under the Apache 2.0 license.

Docs released under Creative commons.