This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Exporting PATH in Dockerfile

Hi,

I'm having issues setting python 2.7 as the default version of python in conda which is in a docker container. I have attempted to remedy this by exporting the path of python 2.7 under the conda environment in the Dockerfile:

Dockerfile:

FROM nfcore/base
LABEL authors="Barry Digby" \
   description="Docker image"

COPY environment.yml /

RUN conda env create -f /environment.yml python=2.7.15 && conda clean -a

ENV PATH /opt/conda/envs/circrna/bin:$PATH

However when I shell into the container which python returns /opt/conda/bin/python (3.7.6).

echo $PATH returns /opt/conda/bin:/opt/conda/condabin:/opt/conda/envs/circrna/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin so I can see that the Dockerfile does indeed append the path but it is not set as the leftmost path i.e the default.

Any tips on overriding this in the Dockerfile?

Thanks in advance,

Barry

conda docker python

0 answers

No answers yet.

Log in to answer this question.