-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathDockerfile
97 lines (69 loc) · 2.8 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
# This is the docker file to setup: OpenCV3 + Python3 environment
FROM ubuntu:latest
MAINTAINER Riaz Munshi # [email protected]
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install software-properties-common
#==========OpenCV pre-requisites=========
RUN add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
RUN apt-get update
RUN apt-get -y install cmake git pkg-config
RUN apt-get -y install libjpeg8-dev libtiff5-dev libjasper-dev libpng-dev
RUN apt-get -y install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk-3-dev libxvidcore-dev libx264-dev
RUN apt-get -y install libatlas-base-dev gfortran
#=========================================
#=============Installing Python=================
RUN apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
#================================================
#========== Installing Python dev================
RUN apt-get -y install python2.7-dev python3.6-dev
#================================================
#========== Installing Dlib Prerequisite==========
RUN apt-get -y install libboost-all-dev
#=================================================
# Additional step needed to avoid the permission denied error
RUN rm -rf ~/.cache/pip/
RUN pip install numpy
# Building and Installing OpenCV3 with Python 3
# Make sure that version of opencv and opencv_contrib are the same
# Eg: 3.1.0 in our case
# Downloading OpenCV3
CMD ["cd", "~"]
RUN git clone https://github.com/Itseez/opencv.git && cd opencv && git checkout 3.1.0
# Downloading OpenCV3_contrib
CMD ["cd" ,"~"]
RUN git clone https://github.com/Itseez/opencv_contrib.git && cd opencv_contrib && git checkout 3.1.0
#Installing OpenCV3
CMD ["cd", "~"]
##CMD ["mkdir", "build"]
##CMD ["cd", "build"]
RUN cd opencv && mkdir build && cd build && cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local \
# -D INSTALL_C_EXAMPLES=ON \
# -D INSTALL_PYTHON_EXAMPLES=ON \
# -D BUILD_PYTHON_SUPPORT=ON \
-DENABLE_PRECOMPILED_HEADERS=OFF \
-D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON .. && make -j4 && make install && ldconfig
#RUN ln -s /usr/local/lib/python3.4/site-packages/cv2.cpython-34m.so cv2.so
# Installing Flask
RUN pip install Flask
# Installing Tensorflow
RUN pip3 install tensorflow
# Installing Ipython
RUN apt-get -y install python-dev ipython
# Installing Jupyter
RUN pip3 install jupyter
RUN python -m pip install ipykernel
RUN python -m ipykernel install --user
# Installing Dlib
RUN pip3 install scipy
RUN pip3 install scikit-image
RUN pip3 install dlib
COPY jupyter_notebook_config.py /root/.jupyter/
# setting my tmux - terminal multiplexer
RUN apt-get -y install tmux
# Setting up the work directory
RUN mkdir /src
WORKDIR "/src"