I want to use miniconda within a container coming from a Dockerfile based on Debian. I have seen several similar questions here
- Add Miniconda binaries to path in Docker container
- How to install packages with miniconda in Dockerfile?
- Problems running conda update in a dockerfile
But I have not been able to make it work with the answers there. My Dockerfile starts with:
RUN sudo apt-get update && sudo apt-get install -y build-essential gconf-service libasound2 libatk1.0-0 libcairo2 \
libcups2 libfontconfig1 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libxss1 fonts-liberation \
libappindicator1 libnss3 lsb-release xdg-utils wget libappindicator3-1 libgbm1 python3-dev nano
There is a chunk of code related to miniconda that seems to work during the Dockerfile compilation, which is:
ENV PATH="/root/miniconda3/bin:$PATH"
ARG PATH="/root/miniconda3/bin:$PATH"
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda --version
This doesn't throw any error, but if I enter to a bash console in the generated container, I get conda command not found error. Apart from these, I have tried all proposed solutions in the linked questions with no success. Also, I have tried this:
RUN mkdir -p ~/miniconda3 && \
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 && \
rm -rf ~/miniconda3/miniconda.sh && \
~/miniconda3/bin/conda init bash && \
~/miniconda3/bin/conda init zsh
Which does work if I execute the commands manually within the container in a bash console, but fails if I paste them into the Dockerfile