Home

Awesome

Docker images for geospatial applications

Build Status

docker-gdal-base is a continuous integration system that

See perrygeo/gdal-base on Dockerhub

Packages and version numbers

Dockerfiles are based on python:3.8-slim-buster which in turn is based on Debian 10/Buster.

The following versions built from source:

WEBP_VERSION 1.0.0
ZSTD_VERSION 1.3.4
GEOS_VERSION 3.9.1
LIBTIFF_VERSION 4.1.0
CURL_VERSION 7.73.1
PROJ_VERSION 7.2.1
OPENJPEG_VERSION 2.3.1
GDAL_VERSION 3.2.1
SQLITE_VERSION 3330000

GDAL Drivers

Using the image directly

To run the GDAL command line utilities on local files, on data in the current working directory:

docker run --rm -it \
    --volume $(shell pwd)/:/data \
    perrygeo/gdal-base:latest \
    gdalinfo /data/your.tif

You can set it as an alias to save typing

function with-gdal-base {
    docker run --rm -it --volume $(pwd)/:/data perrygeo/gdal-base:latest "$@"
}

with-gdal-base gdalinfo /data/your.tif

Using the Makefile

Extending the image

Use a multistage build to pull your binaries and shared library objects in /usr/local onto a fresh image.

Example:

FROM perrygeo/gdal-base:latest as builder

# Python dependencies that require compilation
COPY requirements.txt .
RUN python -m pip install cython numpy -c requirements.txt
RUN python -m pip install --no-binary fiona,rasterio,shapely -r requirements.txt
RUN pip uninstall cython --yes

# ------ Second stage
# Start from a clean image
FROM python:3.8-slim-buster as final

# Install some required runtime libraries from apt
RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
        libfreexl1 libxml2 \
    && rm -rf /var/lib/apt/lists/*

# Install the previously-built shared libaries from the builder image
COPY --from=builder /usr/local /usr/local
RUN ldconfig

License

Docker image licensing is a mess. In lieu of clear best practices, I'm making the source code and the associated images on dockerhub available as public domain.

There is no warranty of any kind. You're on your own if you choose to use any of these resources. If the images work for you, great! Please docker pull it, fork it, git clone it, download it, whatever. Thanks to github, travis-ci and dockerhub for donating the computing resources to support open source projects such as this.

Contributing

Ideas for additional drivers or software? Bug fixes? Please create a pull request on this repo with:

If your proposal is aligned with the project's goals, I'll gladly consider it!