Skip to content

Commit 267f558

Browse files
committed
cleanup and verify each package in Dockerfile
1 parent fa4238b commit 267f558

File tree

1 file changed

+71
-72
lines changed

1 file changed

+71
-72
lines changed

Dockerfile

Lines changed: 71 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ LABEL maintainer="Matthew Hanson <matt.a.hanson@gmail.com>"
55
# install system libraries
66
RUN \
77
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; \
119
yum install -y bash-completion --enablerepo=epel; \
1210
yum clean all; \
1311
yum autoremove
@@ -42,131 +40,132 @@ WORKDIR /build
4240

4341
# pkg-config - version > 2.5 required for GDAL 2.3+
4442
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; \
4846
./configure --prefix=$PREFIX CFLAGS="-O2 -Os"; \
4947
make -j ${NPROC} install; \
50-
cd ../; rm -rf pkg-config-*;
48+
cd ../; rm -rf pkg-config
5149

5250
# proj
5351
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; \
5754
./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
6057

6158
# nghttp2
6259
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
6766

6867
# curl
6968
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
7475

7576
# GEOS
7677
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; \
8081
./configure --enable-python --prefix=$PREFIX CFLAGS="-O2 -Os"; \
8182
make -j ${NPROC} install; \
82-
cd ..; rm -rf geos*;
83+
cd ..; rm -rf geos
8384

8485
# szip (for hdf)
8586
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; \
8990
./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
9293

9394
# libhdf4
9495
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; \
9999
./configure \
100100
--prefix=$PREFIX \
101101
--with-szlib=$PREFIX \
102102
--enable-shared \
103103
--disable-netcdf \
104104
--disable-fortran; \
105105
make -j ${NPROC} install; \
106-
cd ..; rm -rf hdf-$HDF4_VERSION*; \
107-
yum remove -y bison flex
106+
cd ..; rm -rf hdf4
108107

109108
# libhdf5
110109
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; \
114113
./configure \
115114
--prefix=$PREFIX \
116115
--with-szlib=$PREFIX; \
117116
make -j ${NPROC} install; \
118-
cd ..; rm -rf hdf5-$HDF5_VERSION*
117+
cd ..; rm -rf hdf5
119118

120119
# NetCDF
121120
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; \
127125
make -j ${NPROC} install; \
128-
cd ..; rm -rf netcdf-c-${NETCDF_VERSION} v$NETCDF_VERSION.tar.gz;
126+
cd ..; rm -rf netcdf
129127

130128
# WEBP
131129
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; \
136134
make -j ${NPROC} install; \
137-
cd ..; rm -rf libwebp-${WEBP_VERSION} libwebp-${WEBP_VERSION}.tar.gz
135+
cd ..; rm -rf webp
138136

139137
# ZSTD
140138
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
146144

147-
# libopenjpeg
145+
# openjpeg
148146
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; \
152150
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX; \
153151
make -j ${NPROC} install; \
154-
cd ../..; rm -rf openjpeg-* v$OPENJPEG_VERSION.tar.gz;
152+
cd ../..; rm -rf openjpeg
155153

154+
# geotiff
156155
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
164163

165164
# GDAL
166165
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; \
170169
./configure \
171170
--disable-debug \
172171
--disable-static \
@@ -185,9 +184,9 @@ RUN \
185184
--with-hide-internal-symbols=yes \
186185
CFLAGS="-O2 -Os" CXXFLAGS="-O2 -Os"; \
187186
make -j ${NPROC} install; \
188-
cd $BUILD; rm -rf gdal-$GDAL_VERSION*
187+
cd ${BUILD}; rm -rf gdal
189188

190189
# Copy shell scripts and config files over
191190
COPY bin/* /usr/local/bin/
192191

193-
WORKDIR /home/geolambda
192+
WORKDIR /home/geolambda

0 commit comments

Comments
 (0)