Source repo for Docker's Documentation
Go to file
Andrea Luzzardi a445ed952e Merge pull request #365 from vieux/add_cpus_mem
Add cpus mem
2015-02-13 11:24:07 -08:00
Godeps Merge pull request #365 from vieux/add_cpus_mem 2015-02-13 11:24:07 -08:00
api Merge pull request #365 from vieux/add_cpus_mem 2015-02-13 11:24:07 -08:00
cluster Move container name matching logic into Node. 2015-02-10 13:25:37 -08:00
discovery update import url 2015-02-11 21:25:55 +08:00
scheduler Dependency Filter: co-schedule dependent containers on the same node. 2015-02-10 13:26:21 -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
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 correct IRC channel 2015-02-13 03:13:34 -07:00
ROADMAP.md Update ROADMAP.md 2015-02-09 11:01:23 -08:00
flags.go Dependency Filter: co-schedule dependent containers on the same node. 2015-02-10 13:26:21 -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 fix port filter cli 2015-02-10 05:21:43 +00:00
userguide.md README: Fix port binding in example. 2015-02-11 17:23:57 -08:00

README.md

Swarm: a Docker-native clustering system Build Status

Docker Swarm Logo

swarm is a simple tool which controls a cluster of Docker hosts and exposes it as a single "virtual" host.

swarm uses the standard Docker API as its frontend, which means any tool which speaks Docker can control swarm transparently: dokku, fig, krane, flynn, deis, docker-ui, shipyard, drone.io, Jenkins... and of course the Docker client itself.

Like the 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 -t -p <swarm_port>:2375 -t 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.