Exporting PATH in Dockerfile
0
0
Entering edit mode
22 months ago
Barry Digby ▴ 980

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 • 2.3k views
ADD COMMENT

Login before adding your answer.

Traffic: 1286 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6