title: Storing secret env variables as separate data container in Docker
body: <p>I want to use 'secret' (passwords etc) env variables from host OS inside docker-compose. </p>
  
  <p>I thought it is possible to achieve this using data container. But it is not working - 'No file present'. Please advice what is wrong and if this doable this way. </p>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '2'
  services:
    web:
      build: .
      command: bundle exec puma
      env_file: .env
      environment:
        - RACK_ENV=production
        - RAILS_ENV=production
      volumes_from:
        - config
      ports:
        - "3000:3000"
      links:
        - db
  
    config:
      image: busybox
      volumes:
        - /myapp/config/.env:.env
  </code></pre>
  
  <p>I also tried to use <code>/myapp/config:/config</code> as volume and <code>/config/.env</code> as env_file but with same result.</p>
  
  <p>Dockerfile doesnt mention or reference 'config' or '.env' in any way.</p>
  
  <p>Thanks for responses.</p>