title: How to get environment variable value from .env file in Dockerfile shell script?
body: <p>How can I access environment variables defined in .env file in shell script?</p>
  
  <p>.env file</p>
  
  <pre><code>USERNAME=user
  PASSWORD=pass
  </code></pre>
  
  <p>Dockerfile</p>
  
  <pre><code>....
  
  COPY ./compose/django/celery/worker/start_celery_flower.sh /start_celery_flower.sh
  RUN sed -i 's/\r//' /start_celery_flower.sh
  RUN chmod +x /start_celery_flower.sh
  
  ....
  </code></pre>
  
  <p>I tried using <code>$USERNAME</code> in shell script, but that is not working. I am able to access these variables in application running inside container.</p>