I’m trying to deploy services in swarm cluster using docker 1.12.1-rc1 and docker-compose 1.8.0
I’ve 4 VMs (NOT created through docker-machine)
VM1 - consul server is running in a docker container (for service discovery)
VM2 - where I want to initialize a swarm master with ‘docker swarm init’ command
VM3 - slave node1
VM4 - slave node2
docker-machine create -d virtualbox --swarm --swarm-master
–swarm-discovery=“consul://$(docker-machine ip nb-consul):8500”
–engine-opt=“cluster-store=consul://$(docker-machine ip nb-consul):8500”
–engine-opt=“cluster-advertise=eth1:2376” nb1
Basically, this command create a vm with docker swarm master with consul details defined. Since I’m not using docker-machine, is there any other options like ‘docker swarm init [options]’ with which I can define my consul server details?
Basically, I want my swarm master node to know where consul is running.
This tutorial is just a guide to create a basic cluster setup. But, my setup needs swarm to be integrated with consul (for service discovery) also. In that case, I’ve to create my swarm cluster with some additional options.
This means when I’m creating the swarm master, ‘docker swarm init --advertise-addr <master_IP>’ command is not sufficient. I need to mention few other options like --cluster-store, --cluster-advertise, etc.
These options can be given in config file (/etc/docker/daemon.json) while starting the daemon. But, I’m using docker 1.12.1 tarball and extracted it. I somehow not able to find which config file this docker binary uses to start.