All Articles

Docker 1.12 - Let's swarm!

Docker 1.12 is probably the most important release since 1.0. Docker 1.12 has added features to make multi-host and multi-container orchestration available for everyone who wants or needs it.

This option was once available to those who had time, resources and money to maintain a distributed platform, but not anymore.

Let’s swarm

  1. Install Docker on multiple servers

  2. Create your swarm on your main server !

docker swarm init
  1. Join your master Server
docker swarm join \
       --token SWMTKN-xxxxx \
       {internalIp}:2377
  1. Check that everything is ok !
docker node ls
  1. Create your overlay network :
    docker network create -d overlay test

  2. Let’s create a service
    docker service create --name nginx --network test --replicas 5 -p 8001:80/tcp nginx

  3. docker service ps nginx

Your service is now replicated across multiple servers and load balanced automatically !

Published 14 Jun 2016