3

听起来 PostGIS 本身无法在... PostGIS Docker 映像中找到。因此,我想我一定是在某个地方错了,但我无法弄清楚。这是我每次基于以下 Dockerfile 构建和启动容器时遇到的错误:

(...)
app_1  | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh
app_1  | CREATE DATABASE
app_1  | Loading PostGIS extensions into template_postgis
app_1  | 2021-02-20 00:09:20.414 CET [91] ERROR:  could not access file "$libdir/postgis-3": No such file or directory
app_1  | 2021-02-20 00:09:20.414 CET [91] STATEMENT:  CREATE EXTENSION IF NOT EXISTS postgis;
app_1  | ERROR:  could not access file "$libdir/postgis-3": No such file or directory

这是生成此错误的 Dockerfile:

FROM postgis/postgis:13-3.1

ENV POSTGRES_DB=somedb
ENV POSTGRES_USER=someuser
ENV POSTGRES_PASSWORD=****

# Dont know why but I have to set these otherwise I got the error:
# initdb: error: invalid locale settings; check LANG and LC_* environment variables    
ENV LC_ALL="C.UTF-8"
ENV LC_CTYPE="C.UTF-8"

RUN set -eux \
    && apt-get update \
    && apt-get install -y wget unzip openjdk-11-jdk
    && echo deb 'http://deb.debian.org/debian testing main' >> /etc/apt/sources.list \
    && apt-get update \
    && export DEBIAN_FRONTEND=noninteractive \
    && apt-get install -y --fix-missing --no-install-recommends tzdata \
       proj-bin gdal-bin libproj-dev proj-data libgeos-dev libgdal-dev \  
    && apt-get -y autoremove --purge && apt-get -y autoclean 

我去了那儿; PostgreSQL 12 和 PostGIS 3.0.1:错误:无法访问文件“$libdir/postgis-3”:Linux 上没有这样的文件或目录,但我真的不知道为什么我应该按照建议在图像中安装 PostGIS应该是 PostGIS-ready... 有人对正在发生的事情以及如何解决它有任何暗示吗?

4

0 回答 0