Skip to content

Instantly share code, notes, and snippets.

@uiur
Created January 24, 2017 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uiur/6e0273eeda444dda6ac8fbafb75d42a6 to your computer and use it in GitHub Desktop.
Save uiur/6e0273eeda444dda6ac8fbafb75d42a6 to your computer and use it in GitHub Desktop.
python3 + caffe
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment