I am trying to create a docker container with some conda environments. When I run the container in interactive mode running
conda update --all
conda env create
You have to add anaconda to the PATH during build time with the ENV
variable before executing anaconda inside the Dockerfile.
RUN bash Anaconda3-2018.12-Linux-x86_64.sh -b && \
echo "export PATH="/root/anaconda3/bin:$PATH"" >> ~/.bashrc && \
/bin/bash -c "source ~/.bashrc"
ENV PATH /root/anaconda3/bin:$PATH
RUN conda update --all
Updating PATH in .bashrc will make it possible to call conda inside the container, when run with docker run
, but not in other RUN
statements in the docker file.