-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
73 lines (54 loc) · 1.78 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
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get upgrade -y
# Install gstreamer and opencv dependencies
RUN \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
# setup python
RUN apt-get install -y python3-pip
RUN \
apt-get install -y \
libgstreamer1.0-0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
gstreamer1.0-doc \
gstreamer1.0-tools \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
python3-gst-1.0 \
python3-gi \
python3-gi-cairo gir1.2-gtk-3.0
RUN apt-get install -y git
# just for testing
RUN apt-get -y install nano net-tools netcat
# install mavlink dependencies: https://github.com/ArduPilot/pymavlink
RUN apt-get install -y gcc python3-dev libxml2-dev libxslt-dev
RUN pip3 install numpy future lxml pymavlink
# get opencv and build it
RUN git clone https://github.com/opencv/opencv.git
RUN apt-get install -y build-essential libssl-dev
RUN apt-get -y install cmake
RUN \
cd opencv && \
git checkout 4.5.4 && \
git submodule update --recursive --init && \
mkdir build && \
cd build && \
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D PYTHON_EXECUTABLE=$(which python3) \
-D BUILD_opencv_python2=OFF \
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
-D PYTHON3_EXECUTABLE=$(which python3) \
-D PYTHON3_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D WITH_GSTREAMER=ON \
-D BUILD_EXAMPLES=ON .. && \
make -j$(nproc) && \
make install && \
ldconfig
ENTRYPOINT ["python3"]