I am trying to use my Scala-Akka application with my MySQL database on two separate Docker containers. I found out that Docker allows developers to associate their application with their databases with a flag named --link. In my Dockerfiles, in which I used to create my images, I add 8080 to it in EXPOSE 3306.
And this is how I run the containers:
docker run -d -p 3306:3306 --name mysql centos6mysql
docker run -d -p 8080:8080 --name scalaapp --link mysql:db centos6scala
After starting the containers, I used docker ps and I can see the active containers. However, it looks like the application container is not using the database from the MySQL container. Does anyone know what happened?
source
share