Problems running conda update in a dockerfile

后端 未结 1 1006
误落风尘
误落风尘 2021-01-21 08:20

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          


        
1条回答
  •  无人及你
    2021-01-21 08:51

    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.

    0 讨论(0)
提交回复
热议问题