-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.opencv
47 lines (44 loc) · 1.09 KB
/
Dockerfile.opencv
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
FROM francoisgervais/tensorflow:2.1.0-cp35 AS base
ARG OPENCV_VERSION=4.2.0
FROM base as build
RUN apt-get update && apt-get -y install --no-install-recommends \
build-essential \
cmake \
gfortran \
libjpeg-dev \
libatlas-base-dev \
libavcodec-dev \
libavformat-dev \
libgtk2.0-dev \
libgtk-3-dev \
libswscale-dev \
libtiff-dev \
libv4l-dev \
libx264-dev \
libxvidcore-dev \
pkg-config \
python3-dev \
wget
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz && \
tar xf ${OPENCV_VERSION}.tar.gz
WORKDIR /opencv-${OPENCV_VERSION}/build
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=_install \
-D ENABLE_NEON=ON \
-D ENABLE_VFPV3=ON \
-D BUILD_TESTS=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF .. && \
make -j16
RUN make install
FROM base
RUN apt-get update && apt-get -y install --no-install-recommends \
libatlas3-base \
libavcodec57 \
libavformat57 \
libgtk-3-0 \
libswscale4 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /opencv-${OPENCV_VERSION}/build/_install/ /usr/local/
RUN ldconfig