- Start a bunch of machines, for example on Digital Ocean. Use the docker image, smallest size will do.
- SSH into each machine, replace
/usr/bin/docker
with the one from the master builds - Add
DOCKER_OPTS="-H 0.0.0.0:2375"
to/etc/default/docker
on each of your hosts - Restart docker on each host by entering
service docker restart
- Build the
swarm
binary on any machine using the swarm builder - Upload the
swarm
binary to each host - On one of the hosts, run
swarm create
and remember theTOKEN
that is returned - On all the hosts, join the swarm cluster by running
swarm join --token=<TOKEN> --addr=<local IP>:2375 &
- Clone the repository:
git clone https://github.com/remmelt/swarm-ui.git
run.sh <TOKEN>
will expose port 80 on the local machine or boot2docker VM- Open 192.168.59.103:80 in your browser
- Note the kill (not delete!) and pause/unpause buttons.
The UI is a Docker container running swarm manage
. The swarm manager connects to your swarm by finding its nodes through the hub's discovery service.
Besides swarm, it's running nginx. Nginx serves up the index.html
that is currently the entire webapp, and reverse proxies to the swarm manager because it does not yet support CORS.
Through the magic that is javascript and a couple of ajax calls to the swarm API, a table gets filled with the information about all nodes running in the swarm.
Neat!
- This will currently only work with boot2docker. Fix it.
- Make the base URL configurable
- Add functionality as it is implemented in swarm