Skip to content

Instantly share code, notes, and snippets.

@TimJMartin
Created November 29, 2017 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TimJMartin/d2863fd815ff975c25fda4d985771557 to your computer and use it in GitHub Desktop.
Save TimJMartin/d2863fd815ff975c25fda4d985771557 to your computer and use it in GitHub Desktop.
Building GDAL on Docker Amazon Linux Image
# Base Image
FROM amazonlinux:latest
MAINTAINER Tim Martin
RUN yum update -y
RUN yum upgrade -y
RUN yum install wget -y
RUN yum install gcc -y
RUN yum install gcc-c++ -y
# Download, unzip, build and install Proj4
RUN wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz
RUN tar -zvxf proj-4.9.3.tar.gz
RUN cd proj-4.9.3/ \
&& ./configure --prefix=/tmp \
&& make \
&& make install
RUN cd ..
# Download, unzip, build static gdal/ogr2ogr
RUN wget http://download.osgeo.org/gdal/2.1.0/gdal-2.1.0.tar.gz
RUN tar -zxvf gdal-2.1.0.tar.gz
RUN cd gdal-2.1.0/ \
&& ./configure \
--with-geos \
--with-geotiff=internal \
--with-hide-internal-symbols \
--with-libtiff=internal \
--with-libz=internal \
--with-threads \
--without-bsb \
--without-cfitsio \
--without-cryptopp \
--without-curl \
--without-dwgdirect \
--without-ecw \
--without-expat \
--without-fme \
--without-freexl \
--without-gif \
--without-gif \
--without-gnm \
--without-grass \
--without-grib \
--without-hdf4 \
--without-hdf5 \
--without-idb \
--without-ingres \
--without-jasper \
--without-jp2mrsid \
--without-jpeg \
--without-kakadu \
--without-libgrass \
--without-libkml \
--without-libtool \
--without-mrf \
--without-mrsid \
--without-mysql \
--without-netcdf \
--without-odbc \
--without-ogdi \
--without-openjpeg \
--without-pcidsk \
--without-pcraster \
--without-pcre \
--without-perl \
--without-pg \
--without-php \
--without-png \
--without-python \
--without-qhull \
--without-sde \
--without-sqlite3 \
--without-webp \
--without-xerces \
--without-xml2 \
--disable-shared \
--enable-static \
--with-static-proj4=/tmp \
--with-threads \
--prefix /tmp \
&& make \
&& make install
RUN yum install zip -y
RUN zip -r complete_gdal.zip tmp
#docker build -t amazonlinux_gdal .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment