-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.24-alpine
More file actions
92 lines (85 loc) · 3.02 KB
/
Dockerfile.24-alpine
File metadata and controls
92 lines (85 loc) · 3.02 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
FROM node:24-alpine
RUN apk add --no-cache \
# Libraries required for `wget`
alpine-sdk \
# Libraries required for `netcdf`
curl-dev \
libxml2-dev \
m4 \
# Libraries required for `eccodes`
cmake \
libaec-dev \
libpng-dev \
perl \
python3 \
# Libraries required for `cdo`
bsd-compat-headers
WORKDIR /libraries
# Download and build zlib (http://www.zlib.net)
ARG ZLIB_VERSION=1.3.1
RUN wget -O zlib.tar.gz http://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz \
&& tar -xzf zlib.tar.gz \
&& rm zlib.tar.gz \
&& cd /libraries/zlib-${ZLIB_VERSION} \
&& ./configure \
--prefix=/usr/local \
&& make \
&& make install
# Download and build hdf5 (https://support.hdfgroup.org/ftp/HDF5/releases)
ARG HDF5_VERSION=1.14.3
RUN wget -O hdf5.tar.gz https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION%.*}/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz \
&& tar -xzf hdf5.tar.gz \
&& rm hdf5.tar.gz \
&& cd /libraries/hdf5-${HDF5_VERSION} \
&& ./configure \
--prefix=/usr/local \
--with-zlib=/usr/local \
--enable-unsupported \
--enable-threadsafe \
&& make \
&& make install
# Download and build netcdf (https://www.unidata.ucar.edu/software/netcdf)
ARG NETCDF_VERSION=4.9.2
RUN wget -O netcdf.tar.gz https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION}/netcdf-c-${NETCDF_VERSION}.tar.gz \
&& tar -xzf netcdf.tar.gz \
&& rm netcdf.tar.gz \
&& cd /libraries/netcdf-c-${NETCDF_VERSION} \
&& CPPFLAGS='-I/usr/local/include' LDFLAGS='-L/usr/local/lib' CFLAGS='-fPIC' ./configure \
--prefix=/usr/local \
--enable-netcdf-4 \
--disable-dependency-tracking \
&& make \
&& make install
# Download and build eccodes (https://confluence.ecmwf.int/display/ECC/Releases)
ARG ECCODES_VERSION=2.34.1
RUN wget -O eccodes.tar.gz https://confluence.ecmwf.int/download/attachments/45757960/eccodes-${ECCODES_VERSION}-Source.tar.gz \
&& tar -xzf eccodes.tar.gz \
&& rm eccodes.tar.gz \
&& cd /libraries/eccodes-${ECCODES_VERSION}-Source \
&& mkdir build \
&& cd /libraries/eccodes-${ECCODES_VERSION}-Source/build \
&& cmake \
-DENABLE_NETCDF=ON \
-DENABLE_PNG=ON \
-DENABLE_ECCODES_THREADS=ON \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/usr/local \
../ \
&& make \
&& make install
# Download and build cdo (https://code.mpimet.mpg.de/projects/cdo/files)
ARG CDO_VERSION=2.4.4
ARG CDO_VERSION_HASH=29649
RUN wget -O cdo.tar.gz https://code.mpimet.mpg.de/attachments/download/${CDO_VERSION_HASH}/cdo-${CDO_VERSION}.tar.gz \
&& tar -xzf cdo.tar.gz \
&& rm cdo.tar.gz \
&& cd /libraries/cdo-${CDO_VERSION} \
&& CFLAGS='-fPIC' CXXFLAGS='-fPIC -std=c++20 -include algorithm -include cstdint' ./configure \
--prefix=/usr/local \
--with-netcdf=/usr/local \
--with-hdf5=/usr/local \
--with-eccodes=/usr/local \
--with-zlib=/usr/local \
--disable-dependency-tracking \
&& make \
&& make install