title: Use docker-compose env variable in Dockerbuild file
body: <p>Having the following docker-compose file:</p>
  
  <pre><code>db:
      build: .
      environment:
          - MYSQL_ROOT_PASSWORD=password
          - ENV=test
      env_file: .env
  </code></pre>
  
  <p>Is there any way to use the env variables declared in docker-compose.yml (either as environment or declared in the env_file) as part of Dockerfile without declaring them in the Dockerfile? Something like this:</p>
  
  <pre><code>FROM java:7
  ADD ${ENV}/data.xml /data/
  CMD ["run.sh"]
  </code></pre>