title: Dockerfile entrypoint bash file that loads .env not visible in container
body: <p>I am trying to develop a Dockerfile for my application that loads a large number of environment variables after initialisation. Somehow, these variables are not reachable when I later execute the following commands:</p>
  
  <pre><code>docker exec -it container_name bash
  printenv
  </code></pre>
  
  <p>My environment variables are not visible. If I load the files manually however, they are:</p>
  
  <pre><code>docker exec -it container_name bash
  source .env
  printenv
  ... environment variables are shown ...
  </code></pre>
  
  <p>This is my dockerfile:</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM python:3.6
  WORKDIR /usr/src/app
  
  COPY requirements.txt /usr/src/app/requirements.txt
  
  RUN pip install -r requirements.txt
  
  COPY . /usr/src/app/
  RUN chmod 755 load_env_variables.sh
  
  ENTRYPOINT ["/bin/bash", "-c", "/usr/src/app/load_env_variables.sh"]
  </code></pre>
  
  <p><strong>load_env_variables.sh</strong></p>
  
  <pre><code>#!/bin/bash
  
  source .env
  python start_application
  </code></pre>
  
  <p>And my .env file contains lines als follows: 'export name=value'.</p>