-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
172 lines (153 loc) · 6.19 KB
/
Dockerfile
File metadata and controls
172 lines (153 loc) · 6.19 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
################################################################################
# Common runtime packages
FROM ubuntu:bionic AS common
ARG TZ=Etc/GMT
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install base requirements
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
bc \
ca-certificates \
ffmpeg \
gdal-bin \
libpcl-dev \
libqt5concurrent5 \
locales \
python3.8 \
python3-gdal \
python3-vtk7 \
unzip \
wget \
xvfb \
zip \
# Cleanup
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
################################################################################
# Build CloudCompare
FROM common AS cc_builder
# Build tools
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
software-properties-common \
cmake \
g++ \
git \
libssl-dev
# GIS repository
RUN add-apt-repository --yes ppa:ubuntugis/ppa && apt-get update
# Development packages
RUN apt-get install -y --no-install-recommends \
# GDAL
libgdal-dev \
libproj-dev \
# CloudCompare
qttools5-dev \
# libpcap-dev \
# libpng-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
# python3-vtk7 \
qtdeclarative5-dev \
# # CGAL
# libcgal-dev \
libcgal-qt5-dev \
# # qPhotoscan
# zlib1g-dev \
# # OpenGL
# libglu1-mesa-dev \
# freeglut3-dev \
# mesa-common-dev \
# mesa-utils
# PCL
libpcl-dev
#===============================================================================
# CloudCompare
WORKDIR /tmp/CloudCompare
# Clone
RUN git clone https://github.com/cloudcompare/CloudCompare.git . --depth 1 --branch v2.11.3 --recursive
RUN git submodule init && git submodule update
# Configure CMake
WORKDIR build
RUN cmake -G "Unix Makefiles" -H.. -B. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/CloudCompare \
-DJSON_ROOT_DIR=/usr/include/jsoncpp \
#-----------------------------------------------------------------------
# https://github.com/CloudCompare/CloudCompare/tree/master/plugins/core/GL
# qEDL | Eye-dome Lighting OpenGL shader
-DPLUGIN_GL_QEDL=ON \
# qSSAO | Screen Space Ambient Occlusion OpenGL shader
-DPLUGIN_GL_QSSAO=ON \
#-----------------------------------------------------------------------
# https://github.com/CloudCompare/CloudCompare/tree/master/plugins/core/Standard
# qAnimation | Animation rendering plugin
-DPLUGIN_STANDARD_QANIMATION=ON \
-DWITH_FFMPEG_SUPPORT=ON \
-DFFMPEG_INCLUDE_DIR=/usr/include/x86_64-linux-gnu \
-DFFMPEG_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
# qBroom | Clean a point cloud with a virtual broom.
-DPLUGIN_STANDARD_QBROOM=ON \
# qCSF | A pointclouds filtering algorithm utilize cloth simulation process(Wuming Zhang; Jianbo Qi; Peng Wan,2015)
-DPLUGIN_STANDARD_QCSF=ON \
# qCompass | A virtual 'compass' for measuring outcrop orientations.
-DPLUGIN_STANDARD_QCOMPASS=ON \
# qFacets | BRGM Fracture detection plugin
-DPLUGIN_STANDARD_QFACETS=ON \
-DOPTION_USE_SHAPE_LIB=ON \
# qHPR | Uses the Hidden Point Removal algorithm for approximating point visibility in an N dimensional point cloud, as seen from a given viewpoint.
-DPLUGIN_STANDARD_QHPR=ON \
# qHoughNormals | Uses the Hough transform to estimate normals in unstructured point clouds
-DPLUGIN_STANDARD_QHOUGH_NORMALS=ON \
-DEIGEN_ROOT_DIR=/usr/include/eigen3 \
# qM3C2 | Multiscale Model to Model Cloud Comparison (M3C2)
-DPLUGIN_STANDARD_QM3C2=ON \
# qPCL | Point Cloud Library wrapper
-DPLUGIN_STANDARD_QPCL=ON \
# qPCV | Ambient Occlusion for mesh or point cloud
-DPLUGIN_STANDARD_QPCV=ON \
# qPoissonRecon | Surface Mesh Reconstruction (for closed surfaces)
-DPLUGIN_STANDARD_QPOISSON_RECON=ON \
-DPOISSON_RECON_WITH_OPEN_MP=ON \
# qRANSAC_SD | Automatic RANSAC Shape Detection
-DPLUGIN_STANDARD_QRANSAC_SD=ON \
# qSRA | Comparison between a point cloud and a surface of revolution
-DPLUGIN_STANDARD_QSRA=ON \
-DOPTION_USE_DXF_LIB=ON \
#-----------------------------------------------------------------------
# https://github.com/CloudCompare/CloudCompare/tree/master/plugins/core/IO
# qAdditionalIO | This plugin adds some less frequently used I/O formats to CloudCompare
-DPLUGIN_IO_QADDITIONAL=ON \
# qCSVMatrixIO | 2.5D CSV matrix I/O filter
-DPLUGIN_IO_QCSV_MATRIX=ON \
# qCoreIO | Allows reading & writing of many file formats.
-DPLUGIN_IO_QCORE=ON \
#-----------------------------------------------------------------------
# GDAL | raster files support | https://github.com/cloudcompare/cloudcompare/blob/master/BUILD.md#optional-setup-for-gdal-support
-DOPTION_USE_GDAL=ON \
# Others
# https://github.com/CloudCompare/CloudCompare/commit/f5a0c9fd788da26450f3fa488b2cf0e4a08d255f
-DCCCORELIB_USE_TBB=ON \
-DCOMPILE_CC_CORE_LIB_WITH_CGAL=ON \
|| gawk 'BEGINFILE{print FILENAME};{print "\t" $0}' *.log
# Build & Install
RUN make
RUN make install
################################################################################
# Final Runtime
FROM common
COPY --from=cc_builder /opt/CloudCompare /opt/CloudCompare
ENV LD_LIBRARY_PATH="/opt/CloudCompare/lib:/opt/CloudCompare/lib/cloudcompare/plugins:$LD_LIBRARY_PATH"
ENV PATH="/opt/CloudCompare/bin:$PATH"
# Mount points for data and scripts
VOLUME [ "/data", "/work" ]
# Enable execution of scripts directly from /work
ENV PATH="/work:${PATH}"
# Default to latest python runtime
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
CMD /bin/sh -c 'xvfb-run CloudCompare -SILENT -CLEAR'