I'm trying to deploy 3 Docker containers, having a dependency relation amongst them (A -> B -> C). Now, each container is supposed to run an Akka-Spray instance, on top of a JVM instance.
The problem is: following usual orchestration approaches, container A has been started but the web server hasn't had time to boot up. If it isn't up and running before container B is operational, container B will never catch up and so forth, with C.
I've been trying the following approach lately: share a data volume between containers; after the web server is ready, a helper script will create an empty file in the volume; run a script (through an Upstart service) that looks for an empty file to show up and fires up the next container.
However, using a service is most likely the cause to this issue: running
sudo docker run -d -it --name=backend -v ~/docker-test/:/docker-test -v ~/aux/:/aux ubuntu /bin/bash -c "</path/to/test/script>"
works fine when done simply in command line, but fails randomly in the script executed by the Upstart service (receive message
"/bin/bash </path/to/test/script> : no such file or directory").
Anyone's come across this, as well? I'd gratefully welcome any suggestions to overcome this.