Home:ALL Converter>docker-compose swarm without docker-machine

docker-compose swarm without docker-machine

Ask Time:2016-09-16T20:52:52         Author:Stobor

Json Formatter

After looking through docker official swarm explanations, github issues and stackoverflow answers im still at a loss on why i am having the problem that i have.

Issue at hand: docker-compose up starts services not in the swarm even though swarm is active and has 2 nodes.

Im using 1.12.1 docker version.

  1. Looking at swarm tutorial i was able to start and scale my swarm using docker service create without any issues.

  2. running docker-compose up with version 2 docker-compose.yml results in services starting outside of swarm, i can see them through docker ps but not docker service ls

I can see that docker-machine as the tool that solves this problems, but then again it needs virtual box to be installed.

so my questions would be

  1. Can i use docker-compose with docker-swarm (NOT docker-engine) without docker-machine and without experimental build bundle functionality?

  2. If docker service create can start a service on any nodes is it an indication that network configuration of the swarm is correct ?

  3. What is the advantages/disadvantages of docker-machine versus experimental build functionality

Author:Stobor,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39532013/docker-compose-swarm-without-docker-machine
Elton Stoneman :

1) No. Docker Compose isn't integrated with the new Swarm Mode yet. Issue 3656 in GitHub is tracking that. If you start containers on a swarm with Docker Compose at the moment, it uses docker run to start containers, which is why you see them all on one node.\n\n2) Yes. Actually you can use docker node ls on the manager to confirm all the nodes are up and active, and docker node inspect to check a particular node, you don't need to create a service to validate the swarm.\n\n3) Docker Machine is also behind the 1.12 release, so if you start a swarm with Docker Machine it will be the 'old' type of swarm. The old Docker Swarm product needed a whole lot of extra setup for a key-value store, TLS etc. which Swarm Mode does for free.",
2016-09-16T13:08:26
yy