Home:ALL Converter>Install GDAL Library in Docker Container

Install GDAL Library in Docker Container

Ask Time:2021-06-02T17:59:05         Author:Approachable

Json Formatter

I'm trying to install GDAL in a docker container running the CVAT tool. The base docker file can be found here https://github.com/openvinotoolkit/cvat/blob/develop/Dockerfile . I modified it to add GDAL using several recommended ways but always seems to run into errors.

This is the current modification I made in the dockerfile for GDAL which still fails.

# Install GDAL
RUN apt-get update
RUN apt-get install -y software-properties-common && apt-get update
RUN add-apt-repository ppa:ubuntugis/ppa &&  apt-get update
RUN apt-get install -y gdal-bin libgdal-dev libpq-dev
ARG CPLUS_INCLUDE_PATH=/usr/include/gdal
ARG C_INCLUDE_PATH=/usr/include/gdal
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`

I also tried adding a specific version of GDAL in the requirements file (https://github.com/openvinotoolkit/cvat/blob/develop/cvat/requirements/base.txt) but it still fails while building GDAL.

How do I install GDAL so that I can run some CRS conversions inside the docker container?

Update: For now just CRS conversions but in the future I need to handle some raster tasks as well so I would prefer to import the full GDAL module.

Author:Approachable,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/67802904/install-gdal-library-in-docker-container
yy