From 5cb4e430b5e405bce4ab30e6d20c15222b10815f Mon Sep 17 00:00:00 2001 From: Carmen Tawalika Date: Wed, 28 Jun 2023 17:43:41 +0200 Subject: [PATCH] Docker alpine: add additional GDAL driver (#3058) In `alpine:3.18` many GDAL drivers were removed from the base package to reduce package size [(see related alpine aports issue here)](https://gitlab.alpinelinux.org/alpine/aports/-/issues/14910). Instead they can be installed individually. A list of all available additional drivers can be found [here](https://pkgs.alpinelinux.org/packages?name=gdal-driver*&branch=v3.18&repo=&arch=x86_64&maintainer=). Few were already removed from 3.15 to 3.17. This PR suggests to add the possibly most common ones. --- docker/alpine/Dockerfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index f88ef4fb64c..07debb9ac2f 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -24,6 +24,16 @@ ENV GRASS_RUN_PACKAGES="\ gcc \ gdal \ gdal-dev \ + gdal-driver-GMLAS \ + gdal-driver-HDF5 \ + gdal-driver-JP2OpenJPEG \ + gdal-driver-LIBKML \ + gdal-driver-MSSQLSpatial \ + gdal-driver-netCDF \ + gdal-driver-ODBC \ + gdal-driver-PG \ + gdal-driver-PNG \ + gdal-driver-WMS \ gdal-tools \ gettext \ geos \ @@ -175,6 +185,14 @@ RUN cp /usr/local/grass84/gui/wxpython/xml/module_items.xml module_items.xml; \ mkdir -p /usr/local/grass84/gui/wxpython/xml/; \ mv module_items.xml /usr/local/grass84/gui/wxpython/xml/module_items.xml; +RUN git clone https://github.com/OSGeo/gdal-grass /src/gdal-grass +WORKDIR /src/gdal-grass +RUN ./configure \ + --with-gdal=/usr/bin/gdal-config \ + --with-grass=/usr/local/grass84 && \ + make -j $NUMTHREADS && \ + make install -j $NUMTHREADS + FROM common as grass @@ -188,9 +206,10 @@ ENV GRASSBIN="/usr/local/bin/grass" \ GRASSBIN=grass \ LC_ALL="en_US.UTF-8" -# Copy GRASS GIS from build image +# Copy GRASS GIS and GDAL GRASS driver from build image COPY --from=build /usr/local/bin/grass /usr/local/bin/grass COPY --from=build /usr/local/grass* /usr/local/grass/ +COPY --from=build /usr/lib/gdalplugins/*_GRASS.so /usr/lib/gdalplugins/ # run simple LAZ test COPY docker/testdata/simple.laz /tmp/ COPY docker/testdata/test_grass_session.py docker/alpine/grass_tests.sh /scripts/