Run Docker Swarm with Upstart

In Ubuntu 14.04, to run a job in background an on startup, you should use Upstart. In this post, I will show you the way to run Swarm with Upstart.  I think that it is more complicated that SystemD used by CoreOS or Ubuntu 15.04.

At the first, we need to open /etc/default/docker file and add a line:

And restart Docker:

We need to do this step so that Docker Daemon run at all interfaces and on port 2375. Now, you ready to run Swarm on the machine.

To run Swarm Join, you create file /etc/init/swarm-join.conf with content:

Now, run Swarm Join job:

To run Swarm Manage, you create file /etc/init/swarm-manage.conf with content:

Now run Swarm Manage job: