repo2docker icon indicating copy to clipboard operation
repo2docker copied to clipboard

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

Open yuvipanda opened this issue 6 years ago • 3 comments

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 avatar May 06 '19 18:05 yuvipanda

I think this is a side effect of #651

yuvipanda avatar May 06 '19 18:05 yuvipanda

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/

betatim avatar May 20 '19 14:05 betatim

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

manics avatar May 17 '21 20:05 manics