I am trying to programatically (within Python) replicate the anaconda environment I am working in locally in a Docker container. However, I want to make one Docker image capable of doing this for an arbitrary environment. I see the process looking something like:
subprocess Python module to run conda env export >> environment.txt.continuumio/anaconda:latest), providing it the environment.txt. The python file the container runs should operate within the Anaconda environment specified by that environment.txt. I know how to do step 1, but I don't see how I could do step 2; how can I, within a Python script, update the anaconda environment (and install the missing packages) in which it operates?