-
Notifications
You must be signed in to change notification settings - Fork 109
/
base.dockerfile
396 lines (383 loc) · 10.6 KB
/
base.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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
FROM alpine:3.15 AS base
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/tudelft3d/3dfier"
LABEL org.opencontainers.image.vendor="3DGI"
LABEL org.opencontainers.image.title="3dfier base"
LABEL org.opencontainers.image.description="Base image for building 3dfier"
LABEL org.opencontainers.image.licenses="GPL-3.0"
LABEL org.opencontainers.image.url="http://tudelft3d.github.io/3dfier"
ARG JOBS
#
# 1 Install FreeXL
#
RUN apk --update add freexl
#
# 2 Install proj
#
ARG PROJ_VERSION=8.1.1
RUN apk --update add sqlite libstdc++ sqlite-libs libgcc && \
apk --update add --virtual .proj4-deps \
make \
gcc \
g++ \
file \
sqlite-dev \
unzip && \
cd /tmp && \
wget http://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz && \
tar xfvz proj-${PROJ_VERSION}.tar.gz && \
rm -f proj-${PROJ_VERSION}.tar.gz && \
wget http://download.osgeo.org/proj/proj-datumgrid-1.8.zip && \
unzip proj-datumgrid-1.8.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-1.8.zip && \
wget http://download.osgeo.org/proj/proj-datumgrid-europe-1.1.zip && \
unzip proj-datumgrid-europe-1.1.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-europe-1.1.zip && \
wget http://download.osgeo.org/proj/proj-datumgrid-north-america-1.1.zip && \
unzip proj-datumgrid-north-america-1.1.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-north-america-1.1.zip && \
wget http://download.osgeo.org/proj/proj-datumgrid-oceania-1.0.zip && \
unzip proj-datumgrid-oceania-1.0.zip -d proj-${PROJ_VERSION}/nad/ && \
rm -f proj-datumgrid-oceania-1.0.zip && \
cd proj-${PROJ_VERSION} && \
./configure \
--disable-tiff \
--without-curl \
--enable-lto \
CFLAGS="-O3" CXXFLAGS="-O3" && \
make -j $JOBS && \
make install && \
echo "Entering root folder" && \
cd / &&\
echo "Cleaning dependencies tmp and manuals" && \
apk del .proj4-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib/libproj*; do strip -s $i 2>/dev/null || /bin/true; done && \
for i in /usr/local/lib/geod*; do strip -s $i 2>/dev/null || /bin/true; done && \
for i in /usr/local/bin/proj*; do strip -s $i 2>/dev/null || /bin/true; done && \
proj
# 3 Install geos
ARG GEOS_VERSION=3.10.1
RUN apk --update add --virtual .geos-deps \
make \
gcc \
g++ \
cmake \
file \
libtool && \
cd /tmp && \
wget http://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2 && \
tar xfvj geos-${GEOS_VERSION}.tar.bz2 && \
rm -f geos-${GEOS_VERSION}.tar.bz2 && \
cd geos-${GEOS_VERSION} && \
mkdir "_build" && \
cd "_build" && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_DOCUMENTATION=OFF \
.. && \
make -j $JOBS && \
ctest && \
make install && \
cd ~ && \
apk del .geos-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib/libgeos*; do strip -s $i 2>/dev/null || /bin/true; done && \
for i in /usr/local/bin/geos-config*; do strip -s $i 2>/dev/null || /bin/true; done
#
# 5 Install geotiff
#
ARG GEOTIFF_VERSION=1.5.1
RUN apk --update add \
zlib \
tiff \
libjpeg && \
apk --update add --virtual .geotiff-deps \
zlib \
make \
gcc \
g++ \
file \
zlib-dev \
tiff-dev \
sqlite-dev \
jpeg-dev && \
cd /tmp && \
wget http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-${GEOTIFF_VERSION}.tar.gz && \
tar xfz libgeotiff-${GEOTIFF_VERSION}.tar.gz && \
rm -f libgeotiff-${GEOTIFF_VERSION}.tar.gz && \
cd libgeotiff-${GEOTIFF_VERSION} && \
./configure --with-jpeg=yes --with-zlib=yes --with-proj=/usr/local && \
make && \
make install && \
cd / && \
apk del .geotiff-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib/libgeotiff*; do strip -s $i 2>/dev/null || /bin/true; done
#
# 6 Install Boost
#
ARG BOOST_VERSION=1_77_0
RUN apk del boost boost-dev && \
apk --update add \
zlib \
zstd \
xz \
icu \
bzip2 \
mpfr4 \
eigen && \
apk --update add --virtual .boost-deps \
zlib-dev \
zstd-dev \
xz-dev \
icu-dev \
bzip2-dev \
make \
gcc \
g++ \
git \
cmake \
linux-headers && \
cd /tmp && \
wget https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_${BOOST_VERSION}.tar.gz && \
tar xzf boost_${BOOST_VERSION}.tar.gz && \
cd boost_${BOOST_VERSION} && \
./bootstrap.sh \
--with-libraries=all \
--libdir=/usr/local/lib \
--includedir=/usr/local/include \
--exec-prefix=/usr/local && \
./b2 \
--libdir=/usr/local/lib \
--includedir=/usr/local/include \
--exec-prefix=/usr/local \
install && \
cd ~ && \
apk del .boost-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib/libboost*; do strip -s $i 2>/dev/null || /bin/true; done
#
# 7 Install LASTools
#
ARG LASTOOLS_VERSION=9ecb4e682153436b044adaeb3b4bfdf556109a0f
RUN apk --update add --virtual .lastools-deps \
which \
make \
cmake \
gcc \
g++ \
file \
git \
libtool && \
cd /tmp && \
git clone https://github.com/LAStools/LAStools.git lastools && \
cd lastools && \
git checkout ${LASTOOLS_VERSION} && \
mkdir "_build" && \
cd "_build" && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j $JOBS && \
make install && \
apk del .lastools-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man
#
# 8 Install CGAL
#
ARG CGAL_VERSION=5.3
RUN apk --update add \
gmp \
mpfr4 \
eigen \
zlib && \
apk --update add --virtual .cgal-deps \
make \
gcc \
gmp-dev \
mpfr-dev \
eigen-dev \
zlib-dev \
g++ \
git \
cmake \
linux-headers && \
cd /tmp && \
wget https://github.com/CGAL/cgal/releases/download/v${CGAL_VERSION}/CGAL-${CGAL_VERSION}.tar.xz && \
tar xf CGAL-${CGAL_VERSION}.tar.xz && \
cd CGAL-${CGAL_VERSION} && \
mkdir build && \
cd build && \
cmake \
-DBoost_NO_BOOST_CMAKE=ON \
-DBoost_NO_SYSTEM_PATHS=ON \
-DBOOST_ROOT=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_examples=OFF \
-DWITH_demos=OFF \
-DWITH_CGAL_Core=ON \
-DWITH_CGAL_Qt5=OFF \
-DWITH_CGAL_ImageIO=OFF \
.. && \
make -j $JOBS && \
make install && \
cd ~ && \
apk del .cgal-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib64/libCGAL*; do strip -s $i 2>/dev/null || /bin/true; done
#
# 9 Install SFCGAL
#
ARG SFCGAL_VERSION=v1.4.1
RUN apk --update add \
gmp \
mpfr4 \
zlib && \
apk --update add --virtual .sfcgal-deps \
make \
gcc \
gmp-dev \
mpfr-dev \
zlib-dev \
g++ \
git \
cmake \
linux-headers && \
cd /tmp && \
git clone https://gitlab.com/Oslandia/SFCGAL.git && \
cd SFCGAL && \
git checkout tags/${SFCGAL_VERSION} && \
mkdir build && \
cd build && \
cmake \
-DBoost_NO_BOOST_CMAKE=TRUE \
-DBoost_NO_SYSTEM_PATHS=TRUE \
-DBOOST_ROOT=/usr/local \
.. && \
make && \
make install && \
cd ~ && \
apk del .sfcgal-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib64/libSFCGAL*; do strip -s $i 2>/dev/null || /bin/true; done
#
# 10 Install PostGIS
#
ARG POSTGIS_VERSION=3.1.4
# RUN ln -sf /usr/local/lib64/libSFCGAL.so /usr/local/lib && \
RUN apk --update add \
curl \
nghttp2 \
zlib \
zstd \
xz \
icu \
bzip2 \
mpfr4 \
perl \
json-c \
libxml2 \
sqlite \
postgresql && \
apk --update add --virtual .postgis-deps \
curl-dev \
nghttp2-dev \
zlib-dev \
zstd-dev \
xz-dev \
icu-dev \
bzip2-dev \
mpfr-dev \
git \
make \
wget \
gcc \
g++ \
file \
perl-dev \
json-c-dev \
libxml2-dev \
sqlite-dev \
postgresql-dev \
tiff-dev \
portablexdr-dev \
linux-headers && \
cd /tmp && \
wget http://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz && \
tar xzf postgis-${POSTGIS_VERSION}.tar.gz && \
cd postgis-${POSTGIS_VERSION} && \
./configure \
--without-raster \
--without-topology \
--without-address-standardizer \
--without-phony-revision \
--without-protobuf && \
make -j $JOBS && \
make install && \
cd ~ && \
apk del .postgis-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man
#
# 11 Install GDAL
#
ARG GDAL_VERSION=3.4.0
RUN apk --update add \
xz-dev \
zstd-dev \
sqlite-dev \
postgresql-dev \
portablexdr-dev && \
apk --update add --virtual .gdal-deps \
make \
gcc \
g++ \
file \
linux-headers && \
cd /tmp && \
wget http://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz && \
tar xzf gdal-${GDAL_VERSION}.tar.gz && \
rm -f gdal-${GDAL_VERSION}.tar.gz && \
cd gdal-${GDAL_VERSION} && \
./configure \
PQ_CFLAGS="-I/usr/include/postgresql" \
PQ_LIBS="-L/usr/lib/postgresql14 -lpq" \
CFLAGS="-g -O3" \
CXXFLAGS="-g -O3" \
--enable-lto && \
make -j $JOBS && \
make install && \
cd ~ && \
apk del .gdal-deps && \
rm -rf /tmp/* && \
rm -rf /user/local/man && \
for i in /usr/local/lib/libgdal*; do strip -s $i 2>/dev/null || /bin/true; done && \
for i in /usr/local/bin/gdal*; do strip -s $i 2>/dev/null || /bin/true; done
#
# 12 Additional build dependencies
#
RUN ln -s /usr/local/lib64/libCGAL.so.13 /usr/local/lib && \
ln -s /usr/local/lib64/libSFCGAL.so.1 /usr/local/lib && \
apk --update add \
gmp \
mpfr4 \
yaml \
bash \
yaml-cpp && \
apk --update add --virtual .3dfier-deps \
make \
gmp-dev \
mpfr-dev \
yaml-dev \
yaml-cpp-dev \
gcc \
g++ \
gdb \
cmake \
linux-headers