Skip to content
This repository was archived by the owner on Oct 21, 2019. It is now read-only.

Commit 2a22ee2

Browse files
author
Darren Weber
committed
Substantial updates to built libraries, with additional python packages
- move the ENV versions to the docker layer that installs the libraries - should provide better docker layer caching - update proj4 to 6.x - add libgeotiff 1.5.x - add sqlite3 - proj4 uses it - it is enabled in gdal build - add a bunch of python GIS packages - pyproj - pycrs - shapely
1 parent 4df4c19 commit 2a22ee2

File tree

1 file changed

+58
-33
lines changed

1 file changed

+58
-33
lines changed

Dockerfile

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,22 @@ RUN yum install -y automake16 libpng-devel nasm
1212
ARG prefix=/var/task
1313
ENV PREFIX=${prefix}
1414

15-
# versions of packages
16-
ENV \
17-
PKGCONFIG_VERSION=0.29.2 \
18-
PROJ_VERSION=5.2.0 \
19-
GEOS_VERSION=3.7.1 \
20-
LIBPNG_VERSION=1.6.36 \
21-
OPENJPEG_VERSION=2.3.1 \
22-
LIBJPEG_TURBO_VERSION=2.0.1 \
23-
WEBP_VERSION=1.0.2 \
24-
ZSTD_VERSION=1.3.8 \
25-
CURL_VERSION=7.59.0 \
26-
NGHTTP2_VERSION=1.35.1 \
27-
GDAL_VERSION=2.4.2
15+
ENV CPPFLAGS="-I${PREFIX}/include $CPPFLAGS"
16+
ENV LDFLAGS="-L${PREFIX}/lib $LDFLAGS"
17+
18+
# pkg-config
19+
ENV PKGCONFIG_VERSION=0.29.2
20+
RUN mkdir /tmp/pkg-config \
21+
&& curl -sfL https://pkg-config.freedesktop.org/releases/pkg-config-${PKGCONFIG_VERSION}.tar.gz | tar zxf - -C /tmp/pkg-config --strip-components=1 \
22+
&& cd /tmp/pkg-config \
23+
&& CFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX \
24+
&& make -j $(nproc) --silent && make install && make clean \
25+
&& rm -rf /tmp/pkg-config
26+
27+
ENV PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/
2828

2929
# nghttp2
30+
ENV NGHTTP2_VERSION=1.35.1
3031
RUN mkdir /tmp/nghttp2 \
3132
&& curl -sfL https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz | tar zxf - -C /tmp/nghttp2 --strip-components=1 \
3233
&& cd /tmp/nghttp2 \
@@ -35,55 +36,64 @@ RUN mkdir /tmp/nghttp2 \
3536
&& rm -rf /tmp/nghttp2
3637

3738
# libcurl
39+
ENV CURL_VERSION=7.59.0
3840
RUN mkdir /tmp/libcurl \
3941
&& curl -sfL https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz | tar zxf - -C /tmp/libcurl --strip-components=1 \
4042
&& cd /tmp/libcurl \
4143
&& ./configure --disable-manual --disable-cookies --with-nghttp2=$PREFIX --prefix=$PREFIX \
4244
&& make -j $(nproc) --silent && make install && make clean \
4345
&& rm -rf /tmp/libcurl
4446

45-
# pkg-config
46-
RUN mkdir /tmp/pkg-config \
47-
&& curl -sfL https://pkg-config.freedesktop.org/releases/pkg-config-$PKGCONFIG_VERSION.tar.gz | tar zxf - -C /tmp/pkg-config --strip-components=1 \
48-
&& cd /tmp/pkg-config \
49-
&& CFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX \
50-
&& make -j $(nproc) --silent && make install && make clean \
51-
&& rm -rf /tmp/pkg-config
52-
53-
# proj
54-
RUN mkdir /tmp/proj \
55-
&& curl -sfL http://download.osgeo.org/proj/proj-$PROJ_VERSION.tar.gz | tar zxf - -C /tmp/proj --strip-components=1 \
56-
&& cd /tmp/proj \
57-
&& CFLAGS="-O2 -Wl,-S" CXXFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX \
58-
&& make && make install && make clean \
59-
&& rm -rf /tmp/proj
47+
# sqlite3
48+
ENV SQLITE3_VERSION=3.29.0
49+
RUN mkdir /tmp/sqlite3 \
50+
&& curl -sfL https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz | tar zxf - -C /tmp/sqlite3 --strip-components=1 \
51+
&& cd /tmp/sqlite3 \
52+
&& ./configure --prefix=$PREFIX \
53+
&& make -j $(nproc) --silent && make install && make clean \
54+
&& rm -rf /tmp/sqlite3
6055

6156
# geos
57+
ENV GEOS_VERSION=3.7.1
6258
RUN mkdir /tmp/geos \
63-
&& curl -sfL http://download.osgeo.org/geos/geos-$GEOS_VERSION.tar.bz2 | tar jxf - -C /tmp/geos --strip-components=1 \
59+
&& curl -sfL http://download.osgeo.org/geos/geos-${GEOS_VERSION}.tar.bz2 | tar jxf - -C /tmp/geos --strip-components=1 \
6460
&& cd /tmp/geos \
6561
&& CFLAGS="-O2 -Wl,-S" CXXFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX \
6662
&& make -j $(nproc) --silent && make install && make clean \
6763
&& rm -rf /tmp/geos
6864

65+
# proj
66+
ENV PROJ_VERSION=6.1.1
67+
RUN mkdir /tmp/proj \
68+
&& curl -sfL http://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz | tar zxf - -C /tmp/proj --strip-components=1 \
69+
&& cd /tmp/proj \
70+
&& CFLAGS="-O2 -Wl,-S" CXXFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX \
71+
&& make && make install && make clean \
72+
&& rm -rf /tmp/proj
73+
6974
# png
75+
ENV LIBPNG_VERSION=1.6.36
7076
RUN mkdir /tmp/png \
7177
&& curl -sfL http://prdownloads.sourceforge.net/libpng/libpng-$LIBPNG_VERSION.tar.gz | tar zxf - -C /tmp/png --strip-components=1 \
7278
&& cd /tmp/png \
7379
&& CFLAGS="-O2 -Wl,-S" CXXFLAGS="-O2 -Wl,-S" ./configure --prefix=$PREFIX \
7480
&& make -j $(nproc) --silent && make install && make clean \
7581
&& rm -rf /tmp/png
82+
ENV LIBPNG_CONFIG=${PREFIX}/bin/libpng-config
83+
RUN ls -l $LIBPNG_CONFIG
7684

7785
# openjpeg
86+
ENV OPENJPEG_VERSION=2.3.1
7887
RUN mkdir /tmp/openjpeg \
79-
&& curl -sfL https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz | tar zxf - -C /tmp/openjpeg --strip-components=1 \
88+
&& curl -sfL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | tar zxf - -C /tmp/openjpeg --strip-components=1 \
8089
&& cd /tmp/openjpeg \
8190
&& mkdir build && cd build \
8291
&& cmake .. -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX \
8392
&& make -j $(nproc) install && make clean \
8493
&& rm -rf /tmp/openjpeg
8594

8695
# jpeg_turbo
96+
ENV LIBJPEG_TURBO_VERSION=2.0.1
8797
RUN mkdir /tmp/jpeg \
8898
&& curl -sfL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${LIBJPEG_TURBO_VERSION}.tar.gz | tar zxf - -C /tmp/jpeg --strip-components=1 \
8999
&& cd /tmp/jpeg \
@@ -92,6 +102,7 @@ RUN mkdir /tmp/jpeg \
92102
&& rm -rf /tmp/jpeg
93103

94104
# webp
105+
ENV WEBP_VERSION=1.0.2
95106
RUN mkdir /tmp/webp \
96107
&& curl -sfL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | tar zxf - -C /tmp/webp --strip-components=1 \
97108
&& cd /tmp/webp \
@@ -100,15 +111,28 @@ RUN mkdir /tmp/webp \
100111
&& rm -rf /tmp/webp
101112

102113
# zstd
114+
ENV ZSTD_VERSION=1.3.8
103115
RUN mkdir /tmp/zstd \
104116
&& curl -sfL https://github.com/facebook/zstd/archive/v${ZSTD_VERSION}.tar.gz | tar zxf - -C /tmp/zstd --strip-components=1 \
105117
&& cd /tmp/zstd \
106118
&& make -j $(nproc) PREFIX=$PREFIX ZSTD_LEGACY_SUPPORT=0 CFLAGS=-O1 --silent && make install PREFIX=$PREFIX ZSTD_LEGACY_SUPPORT=0 CFLAGS=-O1 && make clean \
107119
&& rm -rf /tmp/zstd
108120

109-
ENV PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/
121+
# geotiff
122+
ENV GEOTIFF_VERSION=1.5.1
123+
RUN mkdir /tmp/geotiff \
124+
&& archive="https://github.com/OSGeo/libgeotiff/releases/download/${GEOTIFF_VERSION}/libgeotiff-${GEOTIFF_VERSION}.tar.gz" \
125+
&& curl -sfL ${archive} | tar zxf - -C /tmp/geotiff --strip-components=1 \
126+
&& cd /tmp/geotiff \
127+
&& ./configure --prefix=${PREFIX} \
128+
--with-proj=${PREFIX} \
129+
--with-jpeg=${PREFIX} \
130+
--with-zip=yes \
131+
&& make -j $(nproc) install && make clean \
132+
&& rm -rf /tmp/geotiff
110133

111134
# gdal
135+
ENV GDAL_VERSION=2.4.2
112136
RUN mkdir /tmp/gdal \
113137
&& curl -sfL https://github.com/OSGeo/gdal/archive/v${GDAL_VERSION}.tar.gz | tar zxf - -C /tmp/gdal --strip-components=2
114138

@@ -125,7 +149,9 @@ RUN cd /tmp/gdal \
125149
--with-webp=$PREFIX \
126150
--with-zstd=$PREFIX \
127151
--with-crypto \
152+
--with-geotiff=$PREFIX \
128153
--with-libtiff=internal \
154+
--with-sqlite3 \
129155
--with-threads \
130156
--disable-debug \
131157
--with-hide-internal-symbols=yes \
@@ -164,7 +190,6 @@ RUN cd /tmp/gdal \
164190
--without-python \
165191
--without-qhull \
166192
--without-sde \
167-
--without-sqlite3 \
168193
--without-xerces \
169194
--without-xml2
170195

@@ -186,4 +211,4 @@ ENV PATH=$PREFIX/bin:$PATH
186211
# - https://github.com/numpy/numpy/pull/12783/files
187212
ENV CFLAGS='-std=c99'
188213
RUN pip3 install pip -U && \
189-
pip3 install cython numpy "gdal==${GDAL_VERSION}" rasterio --no-binary :all:
214+
pip3 install cython numpy "gdal==${GDAL_VERSION}" pycrs pyproj rasterio shapely --no-binary :all:

0 commit comments

Comments
 (0)