jupyterhub / repo2docker

Turn repositories into Jupyter-enabled Docker images
https://repo2docker.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.62k stars 362 forks source link

conda env's bin override ~/.local/bin in PATH #674

Open yuvipanda opened 5 years ago

yuvipanda commented 5 years ago

Bug description

PATH in a newly build container image is: /srv/conda/envs/notebook/bin:/srv/conda/condabin:/home/yuvipanda/.local/bin:/home/yuvipanda/.local/bin:/srv/conda/envs/notebook/bin:/srv/conda/bin:/srv/npm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Note that the two conda environments - notebook and condabin - override what ${HOME}/.local/bin or ${REPO_DIR}/.local/bin. IMO this is unintentional - user bin dirs should always be able to override everything.

Expected behaviour

I can put a binary in ${HOME}/.local/bin and that is preferred over a binary in /srv/conda/envs/notebook/bin by default.

Actual behaviour

Binary in /srv/conda/envs/notebook/bin is preferred.

How to reproduce

  1. Install mamba instead of conda #643
  2. Symlink mamba to conda in ${HOME}/.local/bin
  3. During the installation / symlink process, 'conda' points to 'mamba'
  4. When container is running, 'conda' is back to pointing to the 'conda' in the notebook environment.
yuvipanda commented 5 years ago

I think this is a side effect of #651

betatim commented 5 years ago

My guess is that something related to how conda handles activation and such is the culprit for this. At least I read that conda got smarter/new handling for PATH related things. Not dug into this yet though. https://www.anaconda.com/conda-4-6-release/

manics commented 3 years ago

Is this still a problem in the current version of R2D?