Open JohannesWiesner opened 1 year ago
As already mentioned, this issue can be solved by following the solution from here:
https://github.com/conda/conda/issues/12858#issuecomment-1640020652
In a nutshell, the solution is to bake a list of environmental variables into the Dockerfile to imitate the behavior of conda init
. The only difference is, that the first option leads to a global solution (that works both with and without the ---user
flag.
This issue is stale because it has been open for 30 days with no activity.
As already mentioned here, in former versions of neurodocker one was able to activate an environment of choice. I propose to reintroduce this functionality. Though in theory, one could also install everything into the base environment, this doesn't work in our case (conda is not able to resolve complex dependencies, when there are already packages with specific versions installed in the base environment) and is also generally not considered good practice ("leave the base environment untouched").
On top of generally re-introducing this functionality, I would also pitch for a way that is not dependent on any files found in HOME directories. The reason for that is, that in my instiution (and certainly other research facilites)
I already found a way to do this based on this comment (also see the conda docs) and it should be possible to integrate this into neurodocker. The minimum thing to do is to define:
ENV PATH="/opt/miniconda-latest/envs/env_name/bin:$PATH"
where you replaceenv_name
with the environment of your choice (should be possible to work with formatted strings here). Conda init also does a lot of cosmetics (e.g.putting (env_name)
at the front but this should also be possible to hardcode.