-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile_vg
executable file
·92 lines (77 loc) · 2.13 KB
/
Dockerfile_vg
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04
ARG python=3.5
ENV PYTHON_VERSION=${python}
ENV NCCL_VERSION=2.3.5-2+cuda8.0
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
curl \
ca-certificates \
libjpeg-dev \
wget \
libatlas-base-dev \
libboost-all-dev \
libgflags-dev \
libgoogle-glog-dev \
libhdf5-serial-dev \
libleveldb-dev \
liblmdb-dev \
libnccl2=${NCCL_VERSION} \
libnccl-dev=${NCCL_VERSION} \
libopencv-dev \
libprotobuf-dev \
libsnappy-dev \
protobuf-compiler \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
libpng-dev
RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
python${PYTHON_VERSION} get-pip.py && \
rm get-pip.py
RUN ln -sf /usr/bin/python3.5 /usr/bin/python
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu
ENV CAFFE_ROOT=/opt/caffe
WORKDIR $CAFFE_ROOT
COPY ./caffe .
RUN cp Makefile.config.example Makefile.config
RUN for req in $(cat python/requirements.txt) pydot; do pip install $req; done
RUN make clean && make all -j "$(nproc)" && \
make pycaffe
RUN make test -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
ARG PYTHON_BASEDEPS="build-essential python-pip"
ARG PYTHON_BUILDDEPS="libbz2-dev \
libc6-dev \
libgdbm-dev \
libncursesw5-dev \
libreadline-gplv2-dev \
libsqlite3-dev \
libssl-dev \
tk-dev"
# basic packages useful inside the environment
RUN apt-get update && \
apt-get install -y gcc g++ make && \
apt-get install -y nano ${PYTHON_BASEDEPS} ${PYTHON_BUILDDEPS}
# # pip packages
RUN pip install --trusted-host pypi.python.org \
Cython \
h5py \
ipython \
scipy \
tqdm \
cld2-cffi \
jupyterlab \
easydict \
opencv-python
COPY . /workspace
WORKDIR /workspace/lib
RUN python setup.py build_ext --inplace && python setup.py install
ENV PYTHONPATH /workspace/lib:$PYTHONPATH
# Just create a directory to dump output files.
RUN mkdir /outputs
# Expose a port for jupyter lab.
EXPOSE 8880
WORKDIR /workspace