Public | Automated Build

Last pushed: 3 years ago
Short Description
Short description is empty for this repo.
Full Description


This project is to similify the setup for Docker Swarm

And it will enable the flat network among the cluster nodes to similfy the network access.

Build the Swarm and get the latest Docker build

The following command will build the swarm binary with the patch for supporting the cross-host container linking from And it will retrieve the latest Docker binary build.


Generate the token

./swarm create



Modify the Vagrantfile to change the minion numbers, token

Modify the to change the --insecure-registry setting if need


This application is available in the form of a Docker image that you can run as a container by executing this command:

vagrant up
vagrant provision    

Run the Swarm manager (please change the token)

./swarm manage  --discovery token://680b0b72274e2e8c48bcedc05ce54afd -H 

Play with it

docker info
docker run -d dockerfile/nginx

Fig template on Docker Swarm

Try the Fig (please get the latest Fig from

We leverage the pattern from the for the testing. The web container access the db container through link.
NOTE: So far, we cannot support the Fig template with build command, and we need to build the image in Fig template firstly and push it to DockerHub or private docker registry.

    - "8000:8000"
    - db
    MYSQL_DATABASE: wordpress

Then we can use the commond fig command to deploy it into Docker Swarm cluster

yili@jadetest:~/wordpress$ fig up -d
Creating wordpress_db_1...
Creating wordpress_web_1...
yili@jadetest:~/wordpress$ fig ps
     Name                    Command               State             Ports           
wordpress_db_1    /usr/local/bin/run               Up      3306/tcp                  
wordpress_web_1   /bin/sh -c php -S ...   Up>8000/tcp 
yili@jadetest:~/wordpress$ docker ps
CONTAINER ID        IMAGE                                                COMMAND                CREATED             STATUS                  PORTS                       NAMES
920087b75a6b   "/bin/sh -c 'php -S    11 seconds ago      Up Less than a second>8000/tcp   swarm-minion-2/wordpress_web_1   
8966ac5ee014      "/usr/local/bin/run"   34 seconds ago      Up 10 seconds           3306/tcp                    swarm-minion-2/wordpress_db_1    
yili@jadetest:~/wordpress$ fig scale web=2
Starting wordpress_web_2...
yili@jadetest:~/wordpress$ docker ps
CONTAINER ID        IMAGE                                                     COMMAND                CREATED              STATUS              PORTS                       NAMES
85fc2796a48d   "\"/bin/sh -c 'env |   49 seconds ago       Up 30 seconds       3306/tcp                    swarm-minion-1/wordpress_web_2/db,swarm-minion-1/wordpress_web_2/db_1,swarm-minion-1/wordpress_web_2/wordpress_db_1,swarm-minion-1/wordpress_web_2_ambassador_wordpress_db_1   
f536fb5b2c45        "/bin/sh -c 'php -S    52 seconds ago       Up 30 seconds>8000/tcp   swarm-minion-1/wordpress_web_2                                                                                                                                                 
920087b75a6b        "/bin/sh -c 'php -S    About a minute ago   Up About a minute>8000/tcp   swarm-minion-2/wordpress_web_1                                                                                                                                                 
8966ac5ee014           "/usr/local/bin/run"   About a minute ago   Up About a minute   3306/tcp                    swarm-minion-2/wordpress_db_1,swarm-minion-2/wordpress_web_1/db,swarm-minion-2/wordpress_web_1/db_1,swarm-minion-2/wordpress_web_1/wordpress_db_1

And you can access the two different public endpoints for Wordpress deployment, and both of them will link to the same MySQL database container.



Docker Pull Command
Source Repository