-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.Dockerfile
162 lines (146 loc) · 3.55 KB
/
build.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
ARG IMAGE
ARG PREFIX=/usr/local
FROM ${IMAGE} as builder
ARG DEBIAN_FRONTEND=noninteractive
ARG OTB_VERSION
ARG OTB_USE_6S=ON
ARG OTB_USE_SIFTFAST=ON
ARG OTB_WRAP_PYTHON=ON
ARG OTB_WRAP_QGIS=ON
ARG USE_SYSTEM_BOOST=ON
ARG USE_SYSTEM_CURL=ON
ARG USE_SYSTEM_EXPAT=ON
ARG USE_SYSTEM_FFTW=ON
ARG USE_SYSTEM_FREETYPE=ON
ARG USE_SYSTEM_GDAL=ON
ARG USE_SYSTEM_GEOS=ON
ARG USE_SYSTEM_GEOTIFF=ON
ARG USE_SYSTEM_GLEW=ON
ARG USE_SYSTEM_GLFW=ON
ARG USE_SYSTEM_GLUT=ON
ARG USE_SYSTEM_GSL=ON
ARG USE_SYSTEM_HDF4=ON
ARG USE_SYSTEM_HDF5=ON
ARG USE_SYSTEM_ITK=ON
ARG USE_SYSTEM_JPEG=ON
ARG USE_SYSTEM_LIBKML=ON
ARG USE_SYSTEM_LIBSVM=ON
ARG USE_SYSTEM_MUPARSER=ON
ARG USE_SYSTEM_MUPARSERX=ON
ARG USE_SYSTEM_NETCDF=ON
ARG USE_SYSTEM_OPENCV=ON
ARG USE_SYSTEM_OPENJPEG=ON
ARG USE_SYSTEM_OPENSSL=ON
ARG USE_SYSTEM_OPENTHREADS=ON
ARG USE_SYSTEM_OSSIM=ON
ARG USE_SYSTEM_PCRE=ON
ARG USE_SYSTEM_PNG=ON
ARG USE_SYSTEM_PROJ=ON
ARG USE_SYSTEM_QT5=ON
ARG USE_SYSTEM_QWT=ON
ARG USE_SYSTEM_SHARK=OFF
ARG USE_SYSTEM_SQLITE=ON
ARG USE_SYSTEM_SWIG=ON
ARG USE_SYSTEM_TIFF=ON
ARG USE_SYSTEM_TINYXML=ON
ARG USE_SYSTEM_ZLIB=ON
ARG PREFIX
ARG MODE=install
ENV CC=/usr/lib/ccache/gcc \
CXX=/usr/lib/ccache/g++ \
LANG=C.UTF-8 \
PATH=/usr/lib/ccache:$PATH
## Install system dependencies
RUN if [ "$(uname -m)" = "x86_64" ]; then \
apt-get update; \
apt-get -y install \
apt-transport-https \
bzip2 \
ca-certificates \
ccache \
cmake \
curl \
dirmngr \
g++ \
gcc \
git \
make \
nano \
patch \
pkg-config \
python3-dev \
python3-numpy \
python3-pip \
python3-setuptools \
lsb-release \
software-properties-common \
swig \
unzip \
vim \
wget \
zip; \
fi
## Install build dependencies (codename-independent)
RUN if [ "$(uname -m)" = "x86_64" ]; then \
apt-get -y install \
freeglut3-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-thread-dev \
libcurl4-gnutls-dev \
libexpat1-dev \
libfftw3-dev \
libgdal-dev \
libgeotiff-dev \
libglew-dev \
libglfw3-dev \
libgsl-dev \
libinsighttoolkit4-dev \
libkml-dev \
libmuparser-dev \
libmuparserx-dev \
libopencv-core-dev \
libopencv-ml-dev \
libopenthreads-dev \
libpng-dev \
libqt5opengl5-dev \
libqwt-qt5-dev \
libsvm-dev \
libtinyxml-dev \
qtbase5-dev \
qttools5-dev \
default-jdk \
python3-gdal \
python3-setuptools \
libxmu-dev \
libxi-dev \
qttools5-dev-tools \
bison \
gdal-bin; \
fi
## Install build dependencies (codename-dependent)
RUN if [ "$(uname -m)" = "x86_64" ]; then \
. /etc/os-release; \
if $(echo $VERSION_CODENAME | grep -Eq "buster|bullseye|focal"); then \
apt-get -y install libossim-dev; \
fi \
fi
COPY scripts/*.sh /usr/bin/
WORKDIR /var/cache/otb-build
RUN if [ "$(uname -m)" = "x86_64" ]; then \
start.sh; \
else \
mkdir -p ${PREFIX}; \
echo "Orfeo Toolbox (OTB) is only available for linux/amd64." > \
${PREFIX}/OTB_INFO.txt; \
fi
FROM scratch
LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/orfeotoolbox/otbsi" \
org.opencontainers.image.vendor="b-data GmbH" \
org.opencontainers.image.authors="Olivier Benz <[email protected]>"
ARG PREFIX
COPY --from=builder ${PREFIX} ${PREFIX}