From 6c0b9b41296ff90f413cf38c652fa5cc8fa1862a Mon Sep 17 00:00:00 2001 From: liuqi Date: Fri, 2 Mar 2018 11:35:16 +0800 Subject: [PATCH] Support caffe model. --- caffe/Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 caffe/Dockerfile diff --git a/caffe/Dockerfile b/caffe/Dockerfile new file mode 100644 index 00000000..4bf9e94b --- /dev/null +++ b/caffe/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:16.04 +LABEL maintainer caffe-maint@googlegroups.com + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + git \ + wget \ + 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 \ + python-dev \ + python-numpy \ + python-pip \ + python-setuptools \ + python-scipy && \ + rm -rf /var/lib/apt/lists/* + +ENV CAFFE_ROOT=/opt/caffe +WORKDIR $CAFFE_ROOT + +# FIXME: use ARG instead of ENV once DockerHub supports this +# https://github.com/docker/hub-feedback/issues/460 +ENV CLONE_TAG=1.0 + +RUN git clone -b ${CLONE_TAG} --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 .. && \ + 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 + +WORKDIR /mace -- GitLab