title: Docker Compose: Exposing Environment Variables to linked service
body: <p>I'm playing around with Docker Compose to make a container running a Rails App with a Oracle backend.</p>
  
  <p><a href="https://gist.github.com/DVG/ae38b9049efc772ee200" rel="nofollow">Dockerfile and docker-compose.yml</a></p>
  
  <p>This works great until my Docker container tries to install the ruby-oci8 gem, which looks for some oracle specific environment variables.</p>
  
  <p><a href="https://github.com/wnameless/docker-oracle-xe-11g/blob/master/Dockerfile" rel="nofollow">These variables are exposed in the oracle container's Dockerfile</a>:</p>
  
  <pre><code>RUN 'export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe' 
  </code></pre>
  
  <p>The question is, how do I expose this environment variable on the oracle container to the web container?</p>