forked from 4Quant/digits-docker-binder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
114 lines (94 loc) · 2.73 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Start with Ubuntu base image
FROM ubuntu:16.04
MAINTAINER Kevin Mader <k@4quant.com>
# install basics for adding new repos
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common curl
# Install git, wget, bc, cmake and dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
bc \
cmake \
graphviz \
libgflags-dev \
libgoogle-glog-dev \
libopencv-dev \
libleveldb-dev \
libsnappy-dev \
liblmdb-dev \
libhdf5-serial-dev \
libprotobuf-dev \
protobuf-compiler \
libatlas-base-dev \
python-dev \
python-pip \
python-numpy \
gfortran
# Install boost
RUN apt-get install -y --no-install-recommends libboost-all-dev
# Clone NVIDIA Caffe repo and move into it
RUN cd /root && git clone https://github.com/NVIDIA/caffe.git && cd caffe && \
# Install python dependencies
cat python/requirements.txt | xargs -n1 pip install
MAINTAINER Kai Arulkumaran <design@kaixhin.com>
# Move into NVIDIA Caffe repo
RUN cd /root/caffe && \
# Make and move into build directory
mkdir build && cd build && \
# CMake
cmake .. && \
# Make
make -j"$(nproc)"
# Set CAFFE_HOME
ENV CAFFE_HOME /root/caffe
# Clone DIGITS repo and move into it
RUN cd /root && git clone https://github.com/NVIDIA/DIGITS.git digits && cd digits && \
# pip install
pip install -r requirements.txt
# Enable volumes for host persistence
VOLUME /data
VOLUME /jobs
ENV DIGITS_JOBS_DIR=/jobs
ENV DIGITS_LOGFILE_FILENAME=/jobs/digits.log
# Expose server port
EXPOSE 5000
# Set working directory
WORKDIR /root/digits
# TensorBoard
EXPOSE 6006
# Create basic user
ENV NB_USER jovyan
ENV NB_UID 1000
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
USER root
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && apt-get install -y --no-install-recommends \
python3.6 && \
rm -rf /var/lib/apt/lists/*
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN pip3 install --upgrade setuptools pip
RUN pip3 install jupyter notebook
RUN pip3 install https://github.com/betatim/nbserverproxy/archive/master.zip
ENV HOME /root
# Copy repo into ${HOME}, make user own $HOME
COPY . ${HOME}
WORKDIR ${HOME}
RUN jupyter serverextension enable --py nbserverproxy
RUN pip3 install -e.
RUN jupyter serverextension enable --py nbdlstudioproxy
RUN jupyter nbextension install --py nbdlstudioproxy
RUN jupyter nbextension enable --py nbdlstudioproxy
RUN chown -R ${NB_USER} ${HOME}
WORKDIR ${HOME}/digits
RUN python setup.py install
WORKDIR ${HOME}
USER ${NB_USER}
ENV DIGITS_JOBS_DIR=${HOME}/jobs
ENV DIGITS_LOGFILE_FILENAME=${HOME}/digits.log
ENV PYTHONPATH=/usr/local/python
ENTRYPOINT [""]
CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]