conda docker Mirror

Before the python environment using ubuntu install pip to install python-dependent, but the lack of experience of some version of the library, such as a project need to use faiss, pip only the latest 1.5.3 version, but this version uses the newer CPU command, run on the old server error:

Illegal instruction (core dumped) - in new version of FAISS #885

Prompts to install the old version on github:

If anyone else is struggling and wanna go back to previous working version, use: conda install faiss-cpu=1.5.1 -c pytorch -y

Unfortunately, the following command is not successful, there is no 1.5.1 version:

pip install faiss-cpu==1.5.1

Instead invest conda.

First, download the latest conda installation command:

wget https://repo.anaconda.com/archive/Anaconda3-2019.07-Linux-x86_64.sh

Conda base image is then constructed, or in ubuntu: 16.04 to the end of the package, Dockerfile follows:

from ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
      bzip2 \
      g++ \
      git \
      graphviz \
      libgl1-mesa-glx \
      libhdf5-dev \
      openmpi-bin \
      wget && \
    rm -rf /var/lib/apt/lists/*

RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update

ADD ./Anaconda3-2019.07-Linux-x86_64.sh ./anaconda.sh

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN  /bin/bash ./anaconda.sh -b -p /opt/conda  && rm ./anaconda.sh && ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh  && echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && echo "conda activate base" >> ~/.bashrc && find /opt/conda/ -follow -type f -name '*.a' -delete && find /opt/conda/ -follow -type f -name '*.js.map' -delete &&  /opt/conda/bin/conda clean -afy


CMD [ "/bin/bash" ]

Construct:

docker build -t conda3:1.0 .

Later, you can conda3:1.0 .build a mirror image on the basis of need, for example, we need to install faiss-cpu 1.5.1 version

from conda3:1.0

RUN conda install pytorch -y
RUN conda install faiss-cpu=1.5.1 -c pytorch -y


CMD [ "/bin/bash" ]

Construct:

docker build -t conda-faiss:1.0 .

Author: Jadepeng
Source: jqpeng technical notepad - http://www.cnblogs.com/xiaoqi
Your support is the greatest encouragement blogger, thank you for your read.
This article belongs to the author of all, welcome to reprint, but without the author's consent declared by this section must be retained, and given the original connection in the apparent position of the article page, otherwise the right to pursue legal responsibilities.

Guess you like

Origin www.cnblogs.com/xiaoqi/p/conda-docker.html