Skip to content

Commit

Permalink
docker: hardcode versioned GISBASE path on Alpine (#5137)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason authored Feb 18, 2025
1 parent 2854e29 commit 7bfe274
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,17 @@ RUN echo " => Configure and compile grass" && \
make install && \
ldconfig /etc/ld.so.conf.d

# Build the GDAL-GRASS plugin
# renovate: datasource=github-tags depName=OSGeo/gdal-grass
ARG GDAL_GRASS_VERSION=1.0.3
RUN git clone --branch $GDAL_GRASS_VERSION --depth 1 https://github.com/OSGeo/gdal-grass.git /src/gdal-grass
WORKDIR /src/gdal-grass
RUN cmake -B build -DAUTOLOAD_DIR=/usr/lib/gdalplugins -DBUILD_TESTING=OFF && \
cmake --build build && \
cmake --install build

# Get rid of version number here, restore in next stage via symbolic link
RUN mv $(grass --config path) /usr/local/grass
RUN mv /usr/local/grass85 /usr/local/grass

# Reduce the image size - Remove unnecessary grass files
RUN cp /usr/local/grass/gui/wxpython/xml/module_items.xml module_items.xml; \
Expand All @@ -191,30 +200,21 @@ ENV GRASS_SKIP_MAPSET_OWNER_CHECK=1 \
LC_ALL="en_US.UTF-8" \
PYTHONPATH="/usr/local/grass/etc/python:$PYTHONPATH"

# 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/
# Set GISBASE
ENV GISBASE /usr/local/grass

Check warning on line 208 in docker/alpine/Dockerfile

View workflow job for this annotation

GitHub Actions / alpine for refs/heads/main

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# Build the GDAL-GRASS plugin
# renovate: datasource=github-tags depName=OSGeo/gdal-grass
ARG GDAL_GRASS_VERSION=1.0.3
RUN git clone --branch $GDAL_GRASS_VERSION --depth 1 https://github.com/OSGeo/gdal-grass.git /src/gdal-grass
WORKDIR /src/gdal-grass
RUN cmake -B build -DAUTOLOAD_DIR=/usr/lib/gdalplugins -DBUILD_TESTING=OFF && \
cmake --build build && \
cmake --install build
# Copy GDAL GRASS driver from build image
COPY --from=build /usr/lib/gdalplugins/*_GRASS.so /usr/lib/gdalplugins/
ENV GRASS_GISBASE /usr/local/grass

Check warning on line 209 in docker/alpine/Dockerfile

View workflow job for this annotation

GitHub Actions / alpine for refs/heads/main

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# run simple LAZ test
COPY docker/testdata/simple.laz /tmp/
COPY docker/testdata/test_grass_python.py docker/testdata/test_grass_session.py docker/alpine/grass_tests.sh /scripts/

# run GRASS GIS python session and scan the test LAZ file; some cleanup
# also show installed version
RUN ln -sf /usr/local/grass $(grass --config path); \
RUN ln -sf /usr/local/grass /usr/local/grass85; \
rm -rf /tmp/grasstest_epsg_25832; \
$SHELL /scripts/grass_tests.sh; \
python /scripts/test_grass_session.py && rm -rf /tmp/grasstest_epsg_25832; \
Expand Down

0 comments on commit 7bfe274

Please sign in to comment.