@@ -5,9 +5,7 @@ LABEL maintainer="Matthew Hanson <matt.a.hanson@gmail.com>"
5
5
# install system libraries
6
6
RUN \
7
7
yum makecache fast; \
8
- yum install -y \
9
- wget tar gcc gcc-c++ zip rsync git ssh cmake bzip2 automake \
10
- zlib-devel curl-devel libjpeg-devel glib2-devel; \
8
+ yum install -y wget libpng-devel; \
11
9
yum install -y bash-completion --enablerepo=epel; \
12
10
yum clean all; \
13
11
yum autoremove
@@ -42,131 +40,132 @@ WORKDIR /build
42
40
43
41
# pkg-config - version > 2.5 required for GDAL 2.3+
44
42
RUN \
45
- wget https:// pkg-config.freedesktop.org/releases/pkg-config-$PKGCONFIG_VERSION.tar.gz ; \
46
- tar xvf pkg-config- $PKGCONFIG_VERSION.tar.gz; \
47
- cd pkg-config-$PKGCONFIG_VERSION ; \
43
+ mkdir pkg-config; \
44
+ wget -qO- https:// pkg-config.freedesktop.org/releases/pkg-config- $PKGCONFIG_VERSION.tar.gz \
45
+ | tar xvz -C pkg-config --strip-components=1; cd pkg-config ; \
48
46
./configure --prefix=$PREFIX CFLAGS="-O2 -Os" ; \
49
47
make -j ${NPROC} install; \
50
- cd ../; rm -rf pkg-config-*;
48
+ cd ../; rm -rf pkg-config
51
49
52
50
# proj
53
51
RUN \
54
- wget http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz; \
55
- tar -zvxf proj-$PROJ_VERSION.tar.gz; \
56
- cd proj-$PROJ_VERSION; \
52
+ mkdir proj; \
53
+ wget -qO- http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz | tar xvz -C proj --strip-components=1; cd proj; \
57
54
./configure --prefix=$PREFIX; \
58
- make -j ${NPROC} install; cd ..; \
59
- rm -rf proj-$PROJ_VERSION proj-$PROJ_VERSION.tar.gz
55
+ make -j ${NPROC} install; \
56
+ cd ..; rm -rf proj
60
57
61
58
# nghttp2
62
59
RUN \
63
- curl -sfL https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz | tar zxf - -C nghttp2 --strip-components=1; cd nghttp2; \
64
- ./configure --enable-lib-only --prefix=${PREFIX}; \
65
- make -j ${NPROC} install; \
66
- cd ..; rm -rf nghttp2;
60
+ mkdir nghttp2; \
61
+ wget -qO- https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz \
62
+ | tar xvz -C nghttp2 --strip-components=1; cd nghttp2; \
63
+ ./configure --enable-lib-only --prefix=${PREFIX}; \
64
+ make -j ${NPROC} install; \
65
+ cd ..; rm -rf nghttp2
67
66
68
67
# curl
69
68
RUN \
70
- curl -sfL https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz | tar zxf - -C curl --strip-components=1; cd curl; \
71
- ./configure --prefix=${PREFIX} --disable-manual --disable-cookies --with-nghttp2=${PREFIX} \
72
- make -j $(NPROC) install; \
73
- cd ..; rm -rf curl;
69
+ mkdir curl; \
70
+ wget -qO- https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz \
71
+ | tar xvz -C curl --strip-components=1; cd curl; \
72
+ ./configure --prefix=${PREFIX} --disable-manual --disable-cookies --with-nghttp2=${PREFIX}; \
73
+ make -j ${NPROC} install; \
74
+ cd ..; rm -rf curl
74
75
75
76
# GEOS
76
77
RUN \
77
- wget http://download.osgeo.org/ geos/geos-$GEOS_VERSION.tar.bz2 ; \
78
- tar xjf geos* bz2; \
79
- cd geos* ; \
78
+ mkdir geos; \
79
+ wget -qO- http://download.osgeo.org/ geos/geos-$GEOS_VERSION.tar. bz2 \
80
+ | tar xvj -C geos --strip-components=1; cd geos; \
80
81
./configure --enable-python --prefix=$PREFIX CFLAGS="-O2 -Os" ; \
81
82
make -j ${NPROC} install; \
82
- cd ..; rm -rf geos*;
83
+ cd ..; rm -rf geos
83
84
84
85
# szip (for hdf)
85
86
RUN \
86
- wget https://support.hdfgroup.org/ftp/lib-external/ szip/$SZIP_VERSION/src/szip-$SZIP_VERSION.tar.gz ; \
87
- tar -xvf szip-$SZIP_VERSION.tar.gz; \
88
- cd szip-$SZIP_VERSION ; \
87
+ mkdir szip; \
88
+ wget -qO- https://support.hdfgroup.org/ftp/lib-external/ szip/$SZIP_VERSION/src/szip -$SZIP_VERSION.tar.gz \
89
+ | tar xvz -C szip --strip-components=1; cd szip ; \
89
90
./configure --prefix=$PREFIX; \
90
- make -j ${NPROC} install; cd ..; \
91
- rm -rf szip-$SZIP_VERSION*
91
+ make -j ${NPROC} install; \
92
+ cd ..; rm -rf szip
92
93
93
94
# libhdf4
94
95
RUN \
95
- yum install -y bison flex; \
96
- wget https://support.hdfgroup.org/ftp/HDF/releases/HDF$HDF4_VERSION/src/hdf-$HDF4_VERSION.tar; \
97
- tar -xvf hdf-$HDF4_VERSION.tar; \
98
- cd hdf-$HDF4_VERSION; \
96
+ mkdir hdf4; \
97
+ wget -qO- https://support.hdfgroup.org/ftp/HDF/releases/HDF$HDF4_VERSION/src/hdf-$HDF4_VERSION.tar \
98
+ | tar xv -C hdf4 --strip-components=1; cd hdf4; \
99
99
./configure \
100
100
--prefix=$PREFIX \
101
101
--with-szlib=$PREFIX \
102
102
--enable-shared \
103
103
--disable-netcdf \
104
104
--disable-fortran; \
105
105
make -j ${NPROC} install; \
106
- cd ..; rm -rf hdf-$HDF4_VERSION*; \
107
- yum remove -y bison flex
106
+ cd ..; rm -rf hdf4
108
107
109
108
# libhdf5
110
109
RUN \
111
- wget https://support.hdfgroup.org/ftp/HDF5/current/src/ hdf5-$HDF5_VERSION.tar ; \
112
- tar -xvf hdf5-$HDF5_VERSION. tar; \
113
- cd hdf5-$HDF5_VERSION ; \
110
+ mkdir hdf5; \
111
+ wget -qO- https://support.hdfgroup.org/ftp/HDF5/releases/ hdf5-${ HDF5_VERSION%.*}/hdf5-${HDF5_VERSION}/src/hdf5-$HDF5_VERSION. tar.gz \
112
+ | tar xvz -C hdf5 --strip-components=1; cd hdf5 ; \
114
113
./configure \
115
114
--prefix=$PREFIX \
116
115
--with-szlib=$PREFIX; \
117
116
make -j ${NPROC} install; \
118
- cd ..; rm -rf hdf5-$HDF5_VERSION*
117
+ cd ..; rm -rf hdf5
119
118
120
119
# NetCDF
121
120
RUN \
122
- wget https://github.com/Unidata/netcdf-c/archive/v$NETCDF_VERSION.tar.gz; \
123
- tar -xvf v$NETCDF_VERSION.tar.gz; \
124
- cd netcdf-c-$NETCDF_VERSION; \
125
- ./configure \
126
- --prefix=$PREFIX; \
121
+ mkdir netcdf; \
122
+ wget -qO- https://github.com/Unidata/netcdf-c/archive/v$NETCDF_VERSION.tar.gz \
123
+ | tar xvz -C netcdf --strip-components=1; cd netcdf; \
124
+ ./configure --prefix=$PREFIX --enable-hdf4; \
127
125
make -j ${NPROC} install; \
128
- cd ..; rm -rf netcdf-c-${NETCDF_VERSION} v$NETCDF_VERSION.tar.gz;
126
+ cd ..; rm -rf netcdf
129
127
130
128
# WEBP
131
129
RUN \
132
- wget -q https://storage.googleapis.com/downloads.webmproject.org/releases/ webp/libwebp-${WEBP_VERSION}.tar.gz ; \
133
- tar xzf libwebp-${WEBP_VERSION}.tar.gz; \
134
- cd libwebp-${WEBP_VERSION} ; \
135
- CFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX; \
130
+ mkdir webp; \
131
+ wget -qO- https://storage.googleapis.com/downloads.webmproject.org/releases/webp/ libwebp-${WEBP_VERSION}.tar.gz \
132
+ | tar xvz -C webp --strip-components=1; cd webp ; \
133
+ CFLAGS="-O2 -Wl,-S" PKG_CONFIG_PATH= "/usr/lib64/pkgconfig" ./configure --prefix=$PREFIX; \
136
134
make -j ${NPROC} install; \
137
- cd ..; rm -rf libwebp-${WEBP_VERSION} libwebp-${WEBP_VERSION}.tar.gz
135
+ cd ..; rm -rf webp
138
136
139
137
# ZSTD
140
138
RUN \
141
- wget -q https://github.com/facebook/ zstd/archive/v${ZSTD_VERSION}.tar.gz ; \
142
- tar -zvxf v${ZSTD_VERSION}.tar.gz; \
143
- cd zstd-${ZSTD_VERSION} ; \
144
- make -j ${NPROC} install PREFIX=$PREFIX ZSTD_LEGACY_SUPPORT=0 CFLAGS=-O1 --silent; \
145
- cd ..; rm -rf v${ZSTD_VERSION}.tar.gz zstd-${ZSTD_VERSION}
139
+ mkdir zstd; \
140
+ wget -qO- https://github.com/facebook/zstd/archive/ v${ZSTD_VERSION}.tar.gz \
141
+ | tar -xvz -C zstd --strip-components=1; cd zstd ; \
142
+ make -j ${NPROC} install PREFIX=$PREFIX ZSTD_LEGACY_SUPPORT=0 CFLAGS=-O1 --silent; \
143
+ cd ..; rm -rf zstd
146
144
147
- # libopenjpeg
145
+ # openjpeg
148
146
RUN \
149
- wget https://github.com/uclouvain/ openjpeg/archive/v$OPENJPEG_VERSION.tar.gz ; \
150
- tar xvf v$OPENJPEG_VERSION.tar.gz; \
151
- cd openjpeg-$OPENJPEG_VERSION ; mkdir build; cd build; \
147
+ mkdir openjpeg; \
148
+ wget -qO- https://github.com/uclouvain/openjpeg/archive/ v$OPENJPEG_VERSION.tar.gz \
149
+ | tar xvz -C openjpeg --strip-components=1; cd openjpeg ; mkdir build; cd build; \
152
150
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX; \
153
151
make -j ${NPROC} install; \
154
- cd ../..; rm -rf openjpeg-* v$OPENJPEG_VERSION.tar.gz;
152
+ cd ../..; rm -rf openjpeg
155
153
154
+ # geotiff
156
155
RUN \
157
- wget https://download.osgeo.org/ geotiff/libgeotiff/libgeotiff-$GEOTIFF_VERSION.tar.gz ; \
158
- tar -xzvf libgeotiff-$GEOTIFF_VERSION.tar.gz; \
159
- cd libgeotiff-$GEOTIFF_VERSION ; \
160
- ./configure \
161
- --prefix =${PREFIX} --with-proj=${PREFIX} ;\
162
- make -j ${NPROC} install; cd ..; \
163
- rm -rf libgeotiff-$GEOTIFF_VERSION.tar.gz libgeotiff-$GEOTIFF_VERSION;
156
+ mkdir geotiff; \
157
+ wget -qO- https://download.osgeo.org/geotiff/ libgeotiff/libgeotiff -$GEOTIFF_VERSION.tar.gz \
158
+ | tar xvz -C geotiff --strip-components=1; cd geotiff ; \
159
+ ./configure --prefix=${PREFIX} \
160
+ --with-proj =${PREFIX} --with-jpeg=yes --with-zip=yes ;\
161
+ make -j ${NPROC} install; \
162
+ cd ${BUILD}; rm -rf geotiff
164
163
165
164
# GDAL
166
165
RUN \
167
- wget http://download.osgeo.org/ gdal/$GDAL_VERSION/gdal-$GDAL_VERSION.tar.gz ; \
168
- tar -xzvf gdal-$GDAL_VERSION.tar.gz; \
169
- cd gdal-$GDAL_VERSION ; \
166
+ mkdir gdal; \
167
+ wget -qO- http://download.osgeo.org/ gdal/$GDAL_VERSION/gdal -$GDAL_VERSION.tar.gz \
168
+ | tar xvz -C gdal --strip-components=1; cd gdal ; \
170
169
./configure \
171
170
--disable-debug \
172
171
--disable-static \
@@ -185,9 +184,9 @@ RUN \
185
184
--with-hide-internal-symbols=yes \
186
185
CFLAGS="-O2 -Os" CXXFLAGS="-O2 -Os" ; \
187
186
make -j ${NPROC} install; \
188
- cd $BUILD; rm -rf gdal-$GDAL_VERSION*
187
+ cd ${ BUILD} ; rm -rf gdal
189
188
190
189
# Copy shell scripts and config files over
191
190
COPY bin/* /usr/local/bin/
192
191
193
- WORKDIR /home/geolambda
192
+ WORKDIR /home/geolambda
0 commit comments