title: How do you add a path to PYTHONPATH in a Dockerfile
body: <p>How do you add a path to <code>PYTHONPATH</code> in a Dockerfile? So that when the container is run it has the correct <code>PYTHONPATH</code>? I'm completely new to Docker.</p>
  <p>I've added <code>ENV PYTHONPATH &quot;${PYTHONPATH}:/control&quot;</code> to the Dockerfile as I want to add the directory <code>/control</code> to <code>PYTHONPATH</code>.</p>
  <p>When I access the container's bash with <code>docker exec -it trusting_spence bash</code> and open python and run the commands below the directory <code>control</code> is not on the list.</p>
  <p><code>import sys print(sys.path)</code></p>
  <pre><code>FROM python:2
  RUN pip install requests pymongo
  
  RUN mkdir control
  
  COPY control_file/ /control
  
  ENV PYTHONPATH &quot;${PYTHONPATH}:/control&quot;
  
  CMD [&quot;python&quot;,&quot;control/control_file/job.py&quot;] 
  </code></pre>