Activate python virtualenv in Dockerfile : <p>I have a Dockerfile where I try to activate python virtualenv after what, it should install all dependencies within this env. However, everything still gets installed globally. I used different approaches and non of them worked. I also do not get any errors. Where is a problem?</p>

<p>1.
<code>ENV PATH $PATH:env/bin</code></p>

<p>2.
<code>ENV PATH $PATH:env/bin/activate</code></p>

<p>3.
<code>RUN . env/bin/activate</code></p>

<p>I also followed <a href="https://github.com/GoogleCloudPlatform/python-runtime#kubernetes-engine--other-docker-hosts" rel="noreferrer">an example of a Dockerfile config for the python-runtime image on Google Cloud</a>, which is basically the same stuff as above.</p>

<blockquote>
  <p>Setting these environment variables are the same as running source /env/bin/activate.</p>
</blockquote>

<p><code>ENV VIRTUAL_ENV /env</code></p>

<p><code>ENV PATH /env/bin:$PATH</code></p>

<p>Additionally, what does <code>ENV VIRTUAL_ENV /env</code> mean and how it is used?</p>
