-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
109 lines (94 loc) · 3.18 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
FROM tensorflow/tensorflow:latest-gpu-py3
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
curl \
software-properties-common \
python3-pip \
&& add-apt-repository -y ppa:jonathonf/python-3.6 \
&& apt-get update \
&& apt-get install -y python3.6 python3.6-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# pip has to be installed before setuptools, setuptools has to be installed before tensorflow
RUN python3.6 -m pip install --no-cache-dir -U pip
RUN python3.6 -m pip install --no-cache-dir -U setuptools
# also useful
RUN python3.6 -m pip install --no-cache-dir ipython requests numpy pandas quandl
RUN python3.6 -m pip install --no-cache-dir tensorflow-gpu==1.11.0
# Tensorflow should be fine by here
RUN python3.6-config --includes \
&& cd /usr/bin && rm python3 && ln -s python3.6 python3
RUN apt-get -y update -qq && \
apt-get -y install wget \
unzip \
# Required
build-essential \
cmake \
git \
pkg-config \
libatlas-base-dev \
libgtk2.0-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
# Optional
libtbb2 libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libv4l-dev \
libdc1394-22-dev \
qt4-default \
# Missing libraries for GTK
libatk-adaptor \
libcanberra-gtk-module \
# Tools
imagemagick \
# For use matplotlib.pyplot in python
python3-tk \
python-tk
WORKDIR /
# Get OpenCV
RUN git clone https://github.com/opencv/opencv.git
ENV OPENCV_VERSION=3.4.3
RUN cd opencv &&\
git checkout $OPENCV_VERSION &&\
cd / &&\
# Get OpenCV contrib modules
git clone https://github.com/opencv/opencv_contrib &&\
cd opencv_contrib &&\
git checkout $OPENCV_VERSION &&\
mkdir /opencv/build
RUN cd /opencv/build &&\
# Lets build OpenCV
cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
-D BUILD_EXAMPLES=OFF \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D BUILD_DOCS=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D WITH_TBB=ON \
-D WITH_OPENMP=ON \
-D WITH_IPP=ON \
-D WITH_CSTRIPES=ON \
-D WITH_OPENCL=ON \
-D WITH_V4L=ON \
-D BUILD_opencv_python3=ON \
.. &&\
make -j$NUM_CORES &&\
make install &&\
ldconfig &&\
# Clean the install from sources
cd / &&\
rm -r /opencv &&\
rm -r /opencv_contrib
RUN apt-get update && apt-get -y install libgtk-3-dev libboost-all-dev
RUN pip3 install PyQt5
WORKDIR /src
CMD ["python3", "main.py"]