Question: Exporting PATH in Dockerfile
gravatar for Barry Digby
6 months ago by
Barry Digby640
National University of Ireland, Galway
Barry Digby640 wrote:


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:


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,


docker conda python • 284 views
ADD COMMENTlink modified 6 months ago • written 6 months ago by Barry Digby640
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2104 users visited in the last hour