-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (22 loc) · 893 Bytes
/
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
FROM lambci/lambda:build-python3.7
ENV OPENCV_VERSION 4.1.1
RUN curl -fsSLO https://github.com/opencv/opencv/archive/$OPENCV_VERSION.tar.gz \
&& tar -zxf $OPENCV_VERSION.tar.gz \
&& mv opencv-$OPENCV_VERSION opencv
RUN curl -fsSLO https://github.com/opencv/opencv_contrib/archive/$OPENCV_VERSION.tar.gz \
&& tar -zxf $OPENCV_VERSION.tar.gz \
&& mv opencv_contrib-$OPENCV_VERSION opencv_contrib
RUN yum install -y cmake3
RUN pip install --upgrade pip && pip install numpy
RUN mkdir opencv/build \
&& cd opencv/build \
&& cmake3 \
-DBUILD_SHARED_LIBS=NO \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=../../python \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DPYTHON3_EXECUTABLE=/var/lang/bin/python .. \
&& make install
RUN find python/lib -name *.so | xargs -n 1 strip -s
RUN zip -ry9 cv2.zip python/lib
CMD cp cv2.zip /share