-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
68 lines (57 loc) · 2.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Start with Ubuntu base image
FROM ubuntu:16.04
MAINTAINER Vlad Tamas <[email protected]>
# Install git, wget, bc and dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
bc \
cmake \
libatlas-base-dev \
libatlas-dev \
libboost-all-dev \
libopencv-dev \
libprotobuf-dev \
libgoogle-glog-dev \
libgflags-dev \
protobuf-compiler \
libhdf5-dev \
libleveldb-dev \
liblmdb-dev \
libsnappy-dev \
python-dev \
python-pip \
python-numpy \
gfortran > /dev/null
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
# Use the Forked version of caffe which includes SSD and some fixes. Feel free to replace it with the standard Caffe
RUN git clone https://github.com/weiliu89/caffe.git. && \
git checkout ssd && \
pip install --upgrade pip && \
cd python && for req in $(cat requirements.txt) pydot; do pip install $req; done && cd .. && \
git clone https://github.com/NVIDIA/nccl.git && cd nccl && make -j install && cd .. && rm -rf nccl && \
mkdir build && cd build && \
cmake -DUSE_CUDNN=0 -DUSE_NCCL=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
# manually update numpy
RUN pip --no-cache-dir install -U numpy
ARG TENSORFLOW_VERSION=1.5.0
ARG TENSORFLOW_DEVICE=gpu
ARG TENSORFLOW_APPEND=_gpu
RUN pip --no-cache-dir install https://storage.googleapis.com/tensorflow/linux/${TENSORFLOW_DEVICE}/tensorflow${TENSORFLOW_APPEND}-${TENSORFLOW_VERSION}-cp35-cp35m-linux_x86_64.whl
ARG KERAS_VERSION=2.1.4
ENV KERAS_BACKEND=tensorflow
RUN pip --no-cache-dir install --no-dependencies git+https://github.com/fchollet/keras.git@${KERAS_VERSION}
# quick test and dump package lists
RUN python3 -c "import tensorflow; print(tensorflow.__version__)" \
&& dpkg-query -l > /dpkg-query-l.txt \
&& pip freeze > /pip-freeze.txt
WORKDIR /workspace