Home:ALL Converter>How to add GDAL in docker

How to add GDAL in docker

Ask Time:2018-09-19T09:18:09         Author:Papouche Guinslyzinho

Json Formatter

I am trying to setup Docker and geodjagno. Upon docker-compose up I have this following error:

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.

GDAL is a library that can be found in this image wooyek/geodjango

Dockerfile

 FROM wooyek/geodjango
 ENV PYTHONUNBUFFERED 1
 RUN mkdir /code
 WORKDIR /code
 ADD requirements.txt /code/
 RUN pip install -r requirements.txt
 ADD . /code/

docker-compose

services:

  web:
    build: .
    container_name: web
    command: python3 manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db

  db:
    image: mdillon/postgis
    #command: -e POSTGRES_USER=johndoe -e POSTGRES_PASSWORD=myfakedata -e POSTGRES_DB=myfakedata library/postgres
    environment:
      - POSTGRES_USER=johndoe
      - POSTGRES_PASSWORD=myfakedata
      - POSTGRES_DB=myfakedata
    ports:
      - "5435:5432"


  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

Author:Papouche Guinslyzinho,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52396635/how-to-add-gdal-in-docker
Michael Paragios :

Try adding the following in your Dockerfile:\n\nRUN apt-get update &&\\\n apt-get install -y binutils libproj-dev gdal-bin\n",
2018-09-28T12:49:06
yy