I have a Dockerfile where I tried to activate python virtualenv so that, it should install all dependencies within this env. However, everything still gets installed globally. I used different approaches and none of them worked. I am also not getting any errors. Where is the problem?
1. ENV PATH $PATH:env/bin
2. ENV PATH $PATH:env/bin/activate
3. RUN . env/bin/activate
I also followed an example of a Dockerfile config for the python-runtime image on Google Cloud, which is basically the same stuff as above.
Setting these environment variables are the same as running source /env/bin/activate.
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
Additionally, what does ENV VIRTUAL_ENV /env mean and how it is used?
source ../bin/activatetried ?pip. Build a venv in your Docker image, and then use thepipcorresponding to the target virtualenv for installing packages into that virtualenv. If you call/path/to/venv/bin/pip(note the the full venv path) you'll likely find success.