caffe2镜像制作的Dockerfile

FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
LABEL maintainer="[email protected]"
# caffe2 install with gpu support
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    git \
    libgflags-dev \
    libgoogle-glog-dev \
    libgtest-dev \
    libiomp-dev \
    libleveldb-dev \
    liblmdb-dev \
    libopencv-dev \
    libopenmpi-dev \
    libprotobuf-dev \
    libsnappy-dev \
    openmpi-bin \
    openmpi-doc \
    protobuf-compiler \
    python-dev \
    python-numpy \
    python-pip \
    python-pydot \
    python-setuptools \
    python-scipy \
    wget \
    && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir \
    flask \
    future \
    graphviz \
    hypothesis \
    jupyter \
    matplotlib \
    numpy \
    protobuf \
    pydot \
    python-nvd3 \
    pyyaml \
    requests \
    scikit-image \
    scipy \
    setuptools \
    six \
    tornado \
        opencv-python \
        cython \
        mock
########## INSTALLATION STEPS ###################
RUN git clone --branch master --recursive https://github.com/caffe2/caffe2.git
RUN cd caffe2 && mkdir build && cd build \
    && cmake .. \
    -DCUDA_ARCH_NAME=Manual \
    -DCUDA_ARCH_BIN="35 52 60 61" \
    -DCUDA_ARCH_PTX="61" \
    -DUSE_NNPACK=OFF \
    -DUSE_ROCKSDB=OFF \
    && make -j"$(nproc)" install \
    && ldconfig \
    && make clean \
    && cd .. \

        && rm -rf build \    

#这一步之前的dockerfile其实就是(https://github.com/caffe2/caffe2/blob/master/docker/ubuntu-16.04-cuda8-cudnn6-all-options/Dockerfile)上的官方dockerfile,在这之后我们再对cocoapi和detectron进行安装即可

        && cd /
RUN git clone --branch master --recursive https://github.com/cocodataset/cocoapi.git
RUN cd cocoapi/PythonAPI && make install \
    && cd /
RUN git clone --branch master --recursive https://github.com/facebookresearch/detectron
RUN cd detectron/lib && make \
    && cd /
ENV PYTHONPATH /usr/local

最近发现,如果Dockerfile内容一致,可能会导致最后的imgae id是一致的,因此在每个人制作完全一样的内容的Dockerfile时候,我们可以加入MAINTAINER这一项内容,来进行互相区分。

猜你喜欢

转载自blog.csdn.net/weixin_40516558/article/details/79694694