How the order of building images and starting containers is decided?
It there any criteria followed by the build and up commands?
I have an architecture with selenium-grid, that includes a node (selenium hub) that connects to other nodes (selenium instances). The problem is that it does not work because the hub looks empty, like if no one of selenium instances is connected to it (maybe because the hub is started earlier than the selenium instances).
Compose will use links and volumes_from to determine the starting order. If you're not using those, you may manually start the services in order, e.g. docker-compose up [servicea], then docker-compose up/start [serviceb]
There are some open issues/feature requests to have more options to specify dependencies/starting order, which you can find here in the issue tracker.
If you can link the other issues it could be great. Or a short resume is fine.
The problem is that I am already using links, but they are not enough to determine the order.
I don't have them at hand, but a quick search gave me https://github.com/docker/compose/issues/374, https://github.com/docker/compose/issues/235 but I think there are more.
Oh and these; https://github.com/docker/compose/pull/686, https://github.com/docker/compose/issues/933
I'm not sure if this is relevant, but I'm attempting to use compose to deploy dependent containers across a Swarm cluster, and it seems to be having problems with the link. In my situation, the containers are linked in the docker-compose.yml which is fine for local dev, but meaningless in the cluster since the two containers can be (and are) distributed across hosts. It would be useful to be able to force one container to start before another without necessarily linking the two... maybe a soft link vs the current hard link.
I also use swarm cluster and cannot use links and volume-from. I expect docker-compose up -d node1 node2 node3 start them in order, but does'nt.
We now set a swarm affinity so that linked containers all start on the same node.
#374 should cover the "links are not enough" issue (see my comments in that issue for how to solve the problem).