With containerized applications such as Docker, is it possible to use virtualenv such that the environment stays running from the build process, to when the image is finally run? It seems that creating a virtualenv via pip and running the environment never seems to work.
For example:
RUN pip3 install virtualenv RUN virtualenv venv RUN source venv/bin/activate Would never seem to render a true virtual environment whereas following pip installs would be installed under the environment. The reason I need, or believe I need this setup, is that specific directories use dependencies that are different versions of neighboring directories: Folder B uses numpy version X, whereas Folder C uses numpy version Y.
With Docker, is there a tool or feature that I am forgetting that would allow me to use pip installs like a virtual environment, with different versions of the same dependency in different directories?