-
Notifications
You must be signed in to change notification settings - Fork 88
/
Dockerfile_deps
118 lines (107 loc) · 4.24 KB
/
Dockerfile_deps
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
107
108
109
110
111
112
113
114
115
116
117
118
ARG CUDA_TAG=10.2
ARG OS_TAG=18.04
FROM nvidia/cuda:${CUDA_TAG}-devel-ubuntu${OS_TAG}
LABEL maintainer="AliceVision Team alicevision@googlegroups.com"
# use CUDA_TAG to select the image version to use
# see https://hub.docker.com/r/nvidia/cuda/
#
# For example, to create a ubuntu 16.04 with cuda 8.0 for development, use
# docker build --build-arg CUDA_TAG=8.0 --tag alicevision/cctag-deps:cuda${CUDA_TAG}-ubuntu${OS_TAG} -f Dockerfile_deps .
#
# then execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
# docker run -it --runtime=nvidia cctag_deps
# OS/Version (FILE): cat /etc/issue.net
# Cuda version (ENV): $CUDA_VERSION
# System update
RUN apt-get clean && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
wget \
unzip \
yasm \
libtool \
nasm \
automake \
libpng-dev \
libjpeg-dev \
ffmpeg \
libssl-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libavresample-dev \
&& rm -rf /var/lib/apt/lists/*
ENV DEPS_INSTALL_PATH="/opt"
# Manually install cmake
WORKDIR /tmp/cmake
ENV CMAKE_VERSION=3.24
ENV CMAKE_VERSION_FULL=${CMAKE_VERSION}.2
RUN wget https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION_FULL}.tar.gz && \
tar zxf cmake-${CMAKE_VERSION_FULL}.tar.gz && \
cd cmake-${CMAKE_VERSION_FULL} && \
./bootstrap --prefix=/usr/local -- -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON && \
make -j$(nproc) install && \
cd /tmp && \
rm -rf cmake
ENV BOOST_VERSION="1.80.0"
ENV BOOST_VERSION_FILENAME="1_80_0"
WORKDIR /tmp/boost
RUN wget https://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_FILENAME}.tar.gz && \
tar -xzf boost_${BOOST_VERSION_FILENAME}.tar.gz && \
cd boost_${BOOST_VERSION_FILENAME} && \
./bootstrap.sh --with-libraries=atomic,container,date_time,exception,filesystem,graph,log,math,program_options,regex,serialization,system,test,thread,stacktrace,timer --prefix="${DEPS_INSTALL_PATH}" && \
./b2 link=shared install && \
cd /opt && \
rm -rf /tmp/boost
WORKDIR /tmp/eigen
ENV EIGEN_VERSION="3.4.0"
RUN wget https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_VERSION}/${EIGEN_VERSION}.tar.gz && \
mkdir eigen-${EIGEN_VERSION} && tar xf ${EIGEN_VERSION}.tar.gz -C eigen-${EIGEN_VERSION} --strip-components 1 && \
cd eigen-${EIGEN_VERSION} && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=${DEPS_INSTALL_PATH} && \
make install -j$(nproc) && \
cd /opt && \
rm -rf /tmp/eigen
# install opencv
ENV OPENCV_VERSION="4.7.0"
WORKDIR /tmp/opencv
RUN wget https://github.com/opencv/opencv/archive/"${OPENCV_VERSION}".zip && \
unzip ${OPENCV_VERSION}.zip && \
mkdir -p ./opencv-${OPENCV_VERSION}/build && \
cd ./opencv-${OPENCV_VERSION}/build && \
cmake -DBUILD_TIFF:BOOL=ON \
-DBUILD_opencv_java:BOOL=OFF \
-DWITH_CUDA:BOOL=OFF \
-DINSTALL_C_EXAMPLES=OFF \
-DINSTALL_PYTHON_EXAMPLES=OFF \
-DENABLE_AVX:BOOL=ON \
-DWITH_OPENGL:BOOL=OFF \
-DWITH_TBB:BOOL=OFF \
-DWITH_EIGEN:BOOL=ON \
-DWITH_V4L:BOOL=ON \
-DBUILD_TESTS:BOOL=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PERF_TESTS:BOOL=OFF \
-DDBUILD_SHARED_LIBS=ON \
-DBUILD_LIST=core,videoio,imgproc,imgcodecs,highgui \
-DCMAKE_INSTALL_PREFIX:PATH=${DEPS_INSTALL_PATH} \
-DCMAKE_BUILD_TYPE=RELEASE .. && \
make -j$(nproc) install && \
cd /opt && \
rm -r /tmp/opencv
# install tbb
ENV TBB_VERSION="2021.9.0"
WORKDIR /tmp/tbb
RUN wget https://github.com/oneapi-src/oneTBB/archive/refs/tags/v"${TBB_VERSION}".zip && \
unzip v${TBB_VERSION}.zip && \
mkdir -p ./oneTBB-${TBB_VERSION}/build && \
cd ./oneTBB-${TBB_VERSION}/build && \
cmake -DTBB_TEST:BOOL=OFF \
-DTBB_STRICT:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_INSTALL_PREFIX:PATH=${DEPS_INSTALL_PATH} \
-DCMAKE_BUILD_TYPE=RELEASE .. && \
make -j$(nproc) install && \
cd /opt && \
rm -r /tmp/tbb