-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile_custom
106 lines (87 loc) · 2.94 KB
/
dockerfile_custom
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
FROM ubuntu:20.04
LABEL mantainer="Daniel Sarmiento <[email protected]>"
WORKDIR /opt/build
ARG DEBIAN_FRONTEND=noninteractive
# OpenCV Version
ARG OPENCV_VERSION="4.8.1"
# Install build dependencies
RUN apt-get clean && \
apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
build-essential binutils \
ca-certificates curl \
dbus-x11 \
ffmpeg \
gdb gcc g++ gfortran git \
tar \
lsb-release \
procps \
manpages-dev \
unzip \
zip \
wget \
xauth \
swig \
python3-pip python3-dev python3-numpy python3-distutils \
python3-setuptools python3-pyqt5 python3-opencv \
libboost-python-dev libboost-thread-dev libatlas-base-dev libavcodec-dev \
libavformat-dev libavutil-dev libcanberra-gtk3-module libeigen3-dev \
libglew-dev libgl1-mesa-dev libgl1-mesa-glx libglib2.0-0 libgtk2.0-dev
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends \
build-essential \
git \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libopenjp2-7-dev \
libavformat-dev \
libpq-dev
# cmake cmake-qt-gui
RUN apt-get update \
&& apt-get -y install build-essential \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1-Linux-x86_64.sh \
-q -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /opt/cmake-3.24.1 \
&& /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-3.24.1 \
&& rm /tmp/cmake-install.sh \
&& ln -s /opt/cmake-3.24.1/bin/* /usr/local/bin
COPY ./utility/install-oatpp-modules.sh /install-oatpp-modules.sh
RUN /install-oatpp-modules.sh
WORKDIR /opencv
RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip \
&& wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip \
&& unzip opencv.zip \
&& unzip opencv_contrib.zip \
&& mv opencv-${OPENCV_VERSION} opencv \
&& mv opencv_contrib-${OPENCV_VERSION} opencv_contrib
RUN mkdir /opencv/opencv/build
WORKDIR /opencv/opencv/build
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_EXTRA_MODULES_PATH=/opencv/opencv_contrib/modules \
-D PYTHON_EXECUTABLE=/usr/local/bin/python \
-D BUILD_EXAMPLES=ON .. \
&& make -j 6 && make install && ldconfig
# Build the project dependencies oatpp
ADD . /code/
RUN apt-get update
WORKDIR /code/build/
RUN cmake ..
RUN make -j4
EXPOSE 8000 8000
ENTRYPOINT ["./api_machine_learning-exe"]