Skip to content

Commit

Permalink
Docker alpine: add additional GDAL driver (#3058)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mmacata authored and neteler committed Jun 28, 2023
1 parent 8c66008 commit fa31e7b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -175,6 +185,14 @@ RUN cp /usr/local/grass83/gui/wxpython/xml/module_items.xml module_items.xml; \
mkdir -p /usr/local/grass83/gui/wxpython/xml/; \
mv module_items.xml /usr/local/grass83/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

Expand All @@ -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/
Expand Down

0 comments on commit fa31e7b

Please sign in to comment.