title: Passing environment variables through jar file which app uses
body: <p>I am currently trying out on the docker link between my app and db containers. I've checked on my app container and environment variables are automatically set when I link the containers together. </p>
  
  <p>What I want to do is for my config file, which is packaged into a jar file, to receive the environment variables and set the required values to it. Any advice or help? </p>
  
  <p><img src="https://i.stack.imgur.com/8vpeA.png" alt="My environment variables in the scala app container to connect to MySQL database in another container"></p>
  
  <p>And this is how I create a config file in my jar file to connect to MySQL</p>
  
  <pre><code>database { url="jdbc:mysql://${MYSQL_PORT_3306_TCP_ADDR}:${MYSQL_PORT_3306_TCP_PORT}/mydb" driver="com.mysql.jdbc.Driver"}
  </code></pre>