Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# dem.cpp:
FROM osgeo/gdal
ENV DEBIAN_FRONTEND noninteractive
RUN apt update
RUN apt -y install build-essential
RUN wget -O dem.cpp
RUN g++ dem.cpp -odem -lgdal
FROM alpine
RUN apk update
RUN apk add w3m
# zdem2tif:
RUN w3m -dump \
| sed -n '/import os/,/main(sys.argv)/p' >zdem2tif
RUN sed -i '1i#!/usr/bin/env python3' zdem2tif
RUN chmod a+x zdem2tif
# fgddem:
RUN wget -O fgddem
RUN sed -i '/merge_command.*gdalwarp.*gdalwarp_options/s/"%s"/%s/' fgddem
RUN chmod a+x fgddem
# copy dem, zdem2tif
FROM osgeo/gdal
WORKDIR /usr/local/bin/
COPY --from=0 /tmp/dem .
COPY --from=1 /tmp/zdem2tif .
COPY --from=1 /tmp/fgddem .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.