Skip to content

Instantly share code, notes, and snippets.

@uiur
Created January 24, 2017 07:55
Show Gist options
  • Save uiur/6e0273eeda444dda6ac8fbafb75d42a6 to your computer and use it in GitHub Desktop.
Save uiur/6e0273eeda444dda6ac8fbafb75d42a6 to your computer and use it in GitHub Desktop.

Revisions

  1. uiur created this gist Jan 24, 2017.
    35 changes: 35 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    FROM python:3.5

    RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    wget \
    python3-dev \
    libatlas-base-dev \
    libboost-all-dev \
    libgflags-dev \
    libgoogle-glog-dev \
    libhdf5-serial-dev \
    libleveldb-dev \
    liblmdb-dev \
    libopencv-dev \
    libprotobuf-dev \
    libsnappy-dev \
    protobuf-compiler \
    && rm -rf /var/lib/apt/lists/*

    ENV CAFFE_ROOT=/opt/caffe
    WORKDIR $CAFFE_ROOT

    RUN git clone --depth 1 https://github.com/BVLC/caffe.git . && \
    pip install --upgrade pip && \
    cd python && for req in $(cat requirements.txt) pydot; do pip install $req; done && cd .. && \
    mkdir build && cd build && \
    cmake -DCPU_ONLY=1 -Dpython_version=3 .. && \
    make -j"$(nproc)"

    ENV PYCAFFE_ROOT $CAFFE_ROOT/python
    ENV PYTHONPATH $PYCAFFE_ROOT:$PYTHONPATH
    ENV PATH $CAFFE_ROOT/build/tools:$PYCAFFE_ROOT:$PATH
    RUN echo "$CAFFE_ROOT/build/lib" >> /etc/ld.so.conf.d/caffe.conf && ldconfig