├── .gitignore ├── 3.5 ├── Dockerfile ├── build.sh └── docker_setup │ ├── security.pref │ ├── stable.list │ ├── stable.pref │ ├── testing.list │ └── testing.pref ├── 3.6-shippable ├── Dockerfile └── build.bat ├── 3.6-ubuntu ├── Dockerfile └── build.bat ├── 3.6 ├── Dockerfile └── build.bat ├── 3.7-shippable ├── Dockerfile └── build.bat ├── 3.7-ubuntu ├── Dockerfile └── build.bat ├── 3.8-ci ├── Dockerfile └── build.bat ├── 3.8-ubuntu ├── Dockerfile └── build.bat ├── README.md └── build-latest.bat /.gitignore: -------------------------------------------------------------------------------- 1 | # Pycharm 2 | .idea 3 | 4 | # Python 5 | venv/ 6 | *.pyc 7 | -------------------------------------------------------------------------------- /3.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.5 2 | 3 | # Configure apt to get GDAL files from testing repository 4 | ADD docker_setup/*.pref /etc/apt/preferences.d/ 5 | ADD docker_setup/*.list /etc/apt/sources.list.d/ 6 | RUN apt-get update -y 7 | 8 | # Install GDAL source and set compiler flags (used when pip builds GDAL) 9 | # g++ compiler needs to be installed as gcc has already come from testing repo 10 | RUN apt-get -t testing install -y libgdal-dev g++ 11 | ENV CFLAGS -I/usr/include/gdal 12 | 13 | RUN pip install GDAL>=2.0.3 14 | -------------------------------------------------------------------------------- /3.5/build.sh: -------------------------------------------------------------------------------- 1 | docker build -t thinkwhere/gdal-python . 2 | -------------------------------------------------------------------------------- /3.5/docker_setup/security.pref: -------------------------------------------------------------------------------- 1 | Package: * 2 | Pin: release 1=Debian-Security 3 | Pin-Priority: 1000 4 | -------------------------------------------------------------------------------- /3.5/docker_setup/stable.list: -------------------------------------------------------------------------------- 1 | deb http://httpredir.debian.org/debian stable main contrib non-free 2 | deb-src http://httpredir.debian.org/debian stable main contrib non-free 3 | -------------------------------------------------------------------------------- /3.5/docker_setup/stable.pref: -------------------------------------------------------------------------------- 1 | Package: * 2 | Pin: release a=stable 3 | Pin-Priority: 900 4 | -------------------------------------------------------------------------------- /3.5/docker_setup/testing.list: -------------------------------------------------------------------------------- 1 | deb http://httpredir.debian.org/debian testing main contrib non-free 2 | deb-src http://httpredir.debian.org/debian testing main contrib non-free 3 | -------------------------------------------------------------------------------- /3.5/docker_setup/testing.pref: -------------------------------------------------------------------------------- 1 | Package: * 2 | Pin: release a=testing 3 | Pin-Priority: 750 4 | -------------------------------------------------------------------------------- /3.6-shippable/Dockerfile: -------------------------------------------------------------------------------- 1 | # Docker container that installs Python 3.6, GDAL and necessary shippable dependencies for CI 2 | FROM python:3.6-stretch 3 | 4 | # Update base container install & Setup default locale 5 | RUN apt-get update \ 6 | && apt-get upgrade -y \ 7 | && apt-get install -y --no-install-recommends gettext-base jq locales \ 8 | && rm -rf /var/lib/apt/lists/* \ 9 | && echo en_US.UTF-8 UTF-8 > /etc/locale.gen \ 10 | && locale-gen en_US.UTF-8 11 | 12 | # Add unstable repo to allow us to access latest GDAL builds 13 | # Install PostGIS 14 | RUN echo deb http://ftp.uk.debian.org/debian stable main contrib non-free >> /etc/apt/sources.list \ 15 | && apt-get update \ 16 | && apt-get install -y postgresql-11-postgis-2.5 \ 17 | && rm -rf /var/lib/apt/lists/* 18 | 19 | # Update privs to allow Postgres to run locally 20 | RUN sed -i "s/local all postgres peer/local all postgres trust/" /etc/postgresql/11/main/pg_hba.conf 21 | 22 | # Existing binutils causes a dependency conflict, correct version will be installed when GDAL gets intalled 23 | RUN apt-get remove -y binutils 24 | 25 | # Install GDAL dependencies 26 | RUN apt-get update && apt-get install -y libgdal-dev g++ 27 | 28 | # Update C env vars so compiler can find gdal 29 | ENV CPLUS_INCLUDE_PATH=/usr/include/gdal 30 | ENV C_INCLUDE_PATH=/usr/include/gdal 31 | 32 | # This will install latest version of GDAL 33 | RUN pip install GDAL==2.2.4 34 | 35 | # Install NodeJS, for any JS work 36 | RUN apt-get install -y --no-install-recommends nodejs npm \ 37 | && npm i -g npm node-gyp 38 | 39 | # Install Google Chrome for JS testing 40 | RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ 41 | && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list \ 42 | && apt-get update \ 43 | && apt-get -y install --no-install-recommends google-chrome-stable \ 44 | && apt-get clean \ 45 | && rm -rf /var/lib/apt/lists/* 46 | 47 | 48 | # Install awsebcli for deploying to AWS Elastic Beanstalk 49 | RUN pip install awsebcli awscli 50 | 51 | -------------------------------------------------------------------------------- /3.6-shippable/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.6, GDA 2.2 and Shippable dependencies 2 | docker build -t thinkwhere/gdal-python:3.6-shippable . 3 | -------------------------------------------------------------------------------- /3.6-ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | #### Use latest Ubuntu LTS release as the base 2 | FROM ubuntu:bionic 3 | 4 | # Update base container install with GDAL dependencies 5 | RUN apt-get update \ 6 | && apt-get upgrade -y \ 7 | && apt-get install -y --no-install-recommends python3-pip libgdal-dev locales \ 8 | && locale-gen en_US.UTF-8 \ 9 | && rm -rf /var/lib/apt/lists/* 10 | 11 | ENV LC_ALL='en_US.utf8' 12 | 13 | # Set python aliases for python3 14 | RUN echo 'alias python=python3' >> ~/.bashrc 15 | RUN echo 'alias pip=pip3' >> ~/.bashrc 16 | 17 | # Update C env vars so compiler can find gdal 18 | ENV CPLUS_INCLUDE_PATH=/usr/include/gdal 19 | ENV C_INCLUDE_PATH=/usr/include/gdal 20 | 21 | # This will install latest version of GDAL 22 | RUN pip3 install --upgrade setuptools 23 | RUN pip3 install GDAL==2.2.4 24 | -------------------------------------------------------------------------------- /3.6-ubuntu/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.6, GDAL 2.3 using Ubuntu as base OS 2 | docker build -t thinkwhere/gdal-python:3.6-ubuntu . 3 | -------------------------------------------------------------------------------- /3.6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.6-stretch 2 | 3 | # Update base container install 4 | RUN apt-get update 5 | RUN apt-get upgrade -y 6 | 7 | # Add unstable repo to allow us to access latest GDAL builds 8 | RUN echo deb http://ftp.uk.debian.org/debian unstable main contrib non-free >> /etc/apt/sources.list 9 | RUN apt-get update 10 | 11 | # Existing binutils causes a dependency conflict, correct version will be installed when GDAL gets intalled 12 | RUN apt-get remove -y binutils 13 | 14 | # Install GDAL dependencies 15 | RUN apt-get -t unstable install -y libgdal-dev g++ 16 | 17 | # Update C env vars so compiler can find gdal 18 | ENV CPLUS_INCLUDE_PATH=/usr/include/gdal 19 | ENV C_INCLUDE_PATH=/usr/include/gdal 20 | 21 | # This will install GDAL 2.2.4 22 | RUN pip install GDAL==2.2.4 23 | -------------------------------------------------------------------------------- /3.6/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.6 and GDA 2.2 2 | docker build -t thinkwhere/gdal-python:3.6 . 3 | -------------------------------------------------------------------------------- /3.7-shippable/Dockerfile: -------------------------------------------------------------------------------- 1 | # Docker container that installs Python 3.6, GDAL and necessary shippable dependencies for CI 2 | FROM python:3.7-stretch 3 | 4 | # Update base container install 5 | RUN apt-get update 6 | RUN apt-get upgrade -y 7 | 8 | # Add unstable repo to allow us to access latest GDAL builds 9 | RUN echo deb http://ftp.uk.debian.org/debian stable main contrib non-free >> /etc/apt/sources.list 10 | RUN apt-get update 11 | 12 | ## Install PostGIS 13 | RUN apt-get install -y postgresql-11-postgis-2.5 14 | # 15 | ## Update privs to allow Postgres to run locally 16 | RUN sed -i "s/local all postgres peer/local all postgres trust/" /etc/postgresql/11/main/pg_hba.conf 17 | # 18 | ## Existing binutils causes a dependency conflict, correct version will be installed when GDAL gets intalled 19 | RUN apt-get remove -y binutils 20 | # 21 | ## Install GDAL dependencies 22 | RUN apt-get install -y libgdal-dev g++ 23 | # 24 | ## Update C env vars so compiler can find gdal 25 | ENV CPLUS_INCLUDE_PATH=/usr/include/gdal 26 | ENV C_INCLUDE_PATH=/usr/include/gdal 27 | # 28 | ## This will install latest version of GDAL 29 | RUN pip install GDAL==2.4.2 30 | # 31 | ## Install NodeJS, for any JS work 32 | RUN apt-get install -y nodejs npm 33 | RUN npm i -g npm node-gyp 34 | # 35 | ## Install Google Chrome for JS testing 36 | RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - 37 | RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list 38 | RUN apt-get update 39 | RUN apt-get -y install google-chrome-stable 40 | 41 | ## Setup default locale 42 | RUN echo en_US.UTF-8 UTF-8 > /etc/locale.gen 43 | RUN locale-gen en_US.UTF-8 44 | # 45 | ## Install awsebcli for deploying to AWS Elastic Beanstalk 46 | RUN pip install awsebcli 47 | -------------------------------------------------------------------------------- /3.7-shippable/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.7, GDA 2.4 and Shippable dependencies 2 | docker build -t thinkwhere/gdal-python:3.7-shippable . 3 | -------------------------------------------------------------------------------- /3.7-ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | #### Use latest Ubuntu 2 | FROM ubuntu:eoan 3 | 4 | # Update base container install 5 | RUN apt-get update 6 | RUN apt-get upgrade -y 7 | 8 | # Install GDAL dependencies 9 | RUN apt-get install -y python3-pip libgdal-dev locales 10 | 11 | # Ensure locales configured correctly 12 | RUN locale-gen en_US.UTF-8 13 | ENV LC_ALL='en_US.utf8' 14 | 15 | # Set python aliases for python3 16 | RUN echo 'alias python=python3' >> ~/.bashrc 17 | RUN echo 'alias pip=pip3' >> ~/.bashrc 18 | 19 | # Update C env vars so compiler can find gdal 20 | ENV CPLUS_INCLUDE_PATH=/usr/include/gdal 21 | ENV C_INCLUDE_PATH=/usr/include/gdal 22 | 23 | # This will install latest version of GDAL 24 | RUN pip3 install GDAL==2.4.2 25 | -------------------------------------------------------------------------------- /3.7-ubuntu/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.7, GDAL 2.4 using Ubuntu as base OS 2 | docker build -t thinkwhere/gdal-python:3.7-ubuntu . 3 | -------------------------------------------------------------------------------- /3.8-ci/Dockerfile: -------------------------------------------------------------------------------- 1 | # Docker container that installs Python 3.6, GDAL and necessary shippable dependencies for CI 2 | FROM thinkwhere/gdal-python:gdal3.0.4-py3.8 3 | 4 | # Update base container install 5 | RUN apt-get update \ 6 | && apt-get install -y wget apt-utils 7 | 8 | ## Install PostGIS 9 | RUN apt -y install gnupg2 \ 10 | && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ 11 | && echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ 12 | && apt-get update \ 13 | && apt-get install -y postgresql-11-postgis-2.5 14 | 15 | # 16 | ## Update privs to allow Postgres to run locally 17 | RUN sed -i "s/local all postgres peer/local all postgres trust/" /etc/postgresql/11/main/pg_hba.conf 18 | # 19 | ## Existing binutils causes a dependency conflict, correct version will be installed when GDAL gets intalled 20 | RUN apt-get remove -y binutils 21 | 22 | # 23 | ## Install NodeJS, for any JS work 24 | RUN apt-get install -y nodejs npm \ 25 | && npm i -g npm node-gyp 26 | 27 | # 28 | ## Install Google Chrome for JS testing 29 | RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ 30 | && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list \ 31 | && apt-get update \ 32 | && apt-get -y install google-chrome-stable 33 | 34 | 35 | # 36 | ## Install awsebcli for deploying to AWS Elastic Beanstalk 37 | RUN pip3 install awsebcli 38 | -------------------------------------------------------------------------------- /3.8-ci/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.7, GDA 2.4 and Shippable dependencies 2 | docker build -t thinkwhere/gdal-python-ci:gdal3.0.4-py3.8-pg11 . 3 | -------------------------------------------------------------------------------- /3.8-ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | #### Use latest Ubuntu 2 | FROM ubuntu:focal 3 | 4 | # Update base container install 5 | RUN apt-get update 6 | #RUN apt-get upgrade -y 7 | 8 | ENV TZ 'GB' 9 | RUN echo $TZ > /etc/timezone && \ 10 | apt-get install -y tzdata && \ 11 | rm /etc/localtime && \ 12 | ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ 13 | dpkg-reconfigure -f noninteractive tzdata && \ 14 | apt-get clean 15 | 16 | # Install GDAL dependencies 17 | RUN apt-get install -y python3-pip libgdal-dev locales 18 | 19 | # Ensure locales configured correctly 20 | RUN locale-gen en_GB.UTF-8 21 | ENV LC_ALL='en_GB.utf8' 22 | 23 | # Set python aliases for python3 24 | RUN echo 'alias python=python3' >> ~/.bashrc 25 | RUN echo 'alias pip=pip3' >> ~/.bashrc 26 | 27 | # Update C env vars so compiler can find gdal 28 | ENV CPLUS_INCLUDE_PATH=/usr/include/gdal 29 | ENV C_INCLUDE_PATH=/usr/include/gdal 30 | 31 | # This will install latest version of GDAL 32 | RUN pip3 install GDAL==3.0.4 33 | -------------------------------------------------------------------------------- /3.8-ubuntu/build.bat: -------------------------------------------------------------------------------- 1 | REM Building thinkwhere Docker container for Python 3.7, GDAL 2.4 using Ubuntu as base OS 2 | docker build -t thinkwhere/gdal-python:gdal3.0.4-py3.8 . 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GDAL-Docker 2 | 3 | A GDAL docker container for Python 3 users. [See the Docker Hub Page](https://hub.docker.com/r/thinkwhere/gdal-python/) 4 | 5 | Installs and compiles the latest version of GDAL so that it can be easily added to your app via requirements.txt. 6 | 7 | Just add the following line to requirements.txt: 8 | 9 | ```python 10 | GDAL>=2.2.4 11 | ``` 12 | 13 | ## Running locally 14 | 15 | Run interactively: 16 | 17 | ```bash 18 | docker run -it thinkwhere/gdal-python:3.6-shippable bash 19 | ``` -------------------------------------------------------------------------------- /build-latest.bat: -------------------------------------------------------------------------------- 1 | REM Building latest thinkwhere Docker container for Python 3 and GDAL 2 2 | docker build -t thinkwhere/gdal-python:latest ./3.6 3 | --------------------------------------------------------------------------------