-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
87 lines (68 loc) · 2.83 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
78
79
80
81
82
83
84
85
86
87
FROM ubuntu:22.04
ARG MASTER
ARG USER_ID=1000
ARG GROUP_ID=1000
# Prepare and empty machine for building:
RUN apt-get update -yq
RUN apt-get -yq install build-essential git cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-dev libomp-dev
# Build latest openMVG
RUN git clone --recursive https://github.com/openMVG/openMVG.git ; \
mkdir openMVG_build && cd openMVG_build; \
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/opt/openmvg \
-DOpenMVG_BUILD_TESTS=OFF \
-DOpenMVG_BUILD_EXAMPLES=OFF \
-DOpenMVG_BUILD_DOC=OFF \
-DTARGET_ARCHITECTURE=generic \
../openMVG/src; \
make -j4 &&\
make install; \
cd ..
RUN rm -rf /openMVG; rm -rf /openMVG_build
# Eigen
RUN git clone https://gitlab.com/libeigen/eigen --branch 3.4
RUN mkdir eigen_build
RUN cd eigen_build &&\
cmake . ../eigen &&\
make -j4 && make install &&\
cd ..
RUN rm -rf eigen;
# Boost
RUN apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev
# OpenCV
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq libopencv-dev
# CGAL
RUN apt-get -yq install libcgal-dev libcgal-qt5-dev
# VCGLib
RUN git clone https://github.com/cdcseacave/VCG.git vcglib
# Ceres
RUN apt-get -y install libatlas-base-dev libsuitesparse-dev ; \
git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver ; \
mkdir ceres_build && cd ceres_build ; \
cmake . ../ceres-solver/ -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF ; \
make -j4 && make install ; \
cd ..; \
rm -rf ceres-solver; rm -rf ceres_build
# Clean up
RUN apt-get autoclean && apt-get clean
# cp /openMVG_build/bin/* /bin
# Build from stable openMVS release or the latest commit from the develop branch
RUN if [[ -n "$MASTER" ]] ; then git clone https://github.com/cdcseacave/openMVS.git --branch master ; else git clone https://github.com/cdcseacave/openMVS.git --branch develop ; fi
RUN mkdir openMVS_build
RUN cd openMVS_build &&\
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT=/vcglib -DOpenMVS_USE_CUDA=OFF
# Install OpenMVS library
RUN cd openMVS_build &&\
make -j4 &&\
make install
RUN chmod +x /openMVS/MvgMvsPipeline.py
RUN cp -r /openMVS_build/bin/* /bin; cp /openMVS/MvgMvsPipeline.py /bin/MvgMvsPipeline.py ; rm -rf /openMVS; rm -rf /openMVS_build
# RUN cp -r /opt/openmvg/bin/* /bin;
RUN ln -s /bin/MvgMvsPipeline.py /usr/local/bin/mvgmvs
# Set permissions such that the output files can be accessed by the current user (optional)
RUN addgroup --gid $GROUP_ID user &&\
adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user
USER user
RUN mkdir /home/user/workdir && mkdir /home/user/pictures
# Add binaries to path and sensor_width_camera_database.txt
ENV PATH /usr/local/bin/OpenMVS:/opt/openmvg/bin/:/opt/openmvg/share/openMVG/:/opt/openmvg/lib/openMVG/:$PATH