gpt4 book ai didi

docker - 如何在docker中添加GDAL

转载 作者:行者123 更新时间:2023-12-03 01:34:23 25 4
gpt4 key购买 nike

我正在尝试设置 Docker 和 geodjagno。在 docker-compose up 后,我遇到以下错误:

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 是一个可以在此图片中找到的库 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

最佳答案

尝试在 Dockerfile 中添加以下内容:

RUN apt-get update &&\
apt-get install -y binutils libproj-dev gdal-bin

关于docker - 如何在docker中添加GDAL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52396635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com