Im wondering as to how to start a mongodb replica set using the new Docker 1.12 swarm mode service model. starting a service allows you to specify a number of container replicas, which in the minimal replica set case would be 3. but how would then parameters be specified for the replica set primary, if Docker runs individual containers itself, all with the same name of the service (for contacting the containers over the overlay network)?
how would the replica-set containers be contacting each other with different names? mongodb1,mongodb2,mongodb3 - these would have to be different services?
it was all so straight forward with running dockers 'run' command directly... now it seems a little more confusing for state-full containers (replica set members), as oppose to stateless containers, where all containers of a service are the same...
any pointers or links will be helpful.