-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (62 loc) · 1.82 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
FROM ubuntu:16.04
RUN mkdir /app
WORKDIR /app
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:ubuntu-toolchain-r/test
# Install GCC-9
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
gcc-9 \
g++-9 \
gcc-9-multilib \
g++-9-multilib \
xutils-dev \
patch \
git \
python3 \
python3-pip \
libpulse-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 50 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 50
# Install OpenCV 3.4
RUN apt-get update
RUN apt-get install -y cmake git libgtk2.0-dev pkg-config libavcodec-dev \
libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev \
libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev unzip
RUN apt-get install -y wget
RUN apt-get install -y vim
# get and build OpenCV 3.4
RUN cd \
&& wget https://github.com/opencv/opencv/archive/3.4.0.zip \
&& unzip 3.4.0.zip \
&& cd opencv-3.4.0 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make -j8 \
&& make install \
&& cd \
&& rm 3.4.0.zip
# install and build opencv_contrib
RUN cd \
&& wget https://github.com/opencv/opencv_contrib/archive/3.4.0.zip \
&& unzip 3.4.0.zip \
&& cd opencv-3.4.0/build \
&& cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.0/modules/ .. \
&& make -j8 \
&& make install \
&& cd ../.. \
&& rm 3.4.0.zip
# Install Eigen3
RUN apt install libeigen3-dev
# install CSparse
RUN DEBIAN_FRONTEND=noninteractive apt install -y libsuitesparse-dev
COPY . .
# Build the Library
RUN chmod +x build.sh
RUN ./build.sh
CMD ["/bin/bash"]