Dockerfile升级postgresql 10 python

2024-05-04 19:54:53 发布

您现在位置:Python中文网/ 问答频道 /正文

ENV PG_MAJOR 10
ENV PG_VERSION 10.1-1.pgdg80+1

RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list

RUN apt-get update \
        && apt-get install -y postgresql-common \
        && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
        && apt-get install -y \
                postgresql-$PG_MAJOR \
                postgresql-contrib-$PG_MAJOR \
        && rm -rf /var/lib/apt/lists/*

我在这一部分得到以下错误:

dpkg: error processing package python3.5-minimal (--configure): subprocess installed post-installation script returned error exit status 134 dpkg: dependency problems prevent configuration of python3-minimal: python3-minimal depends on python3.5-minimal (>= 3.5.1-2~); however: Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure): dependency problems - leaving unconfigured Processing triggers for libc-bin (2.23-0ubuntu10) ... Errors were encountered while processing: python3.5-minimal python3-minimal E: Sub-process /usr/bin/dpkg returned an error code (1)


Tags: runenvgetmainpostgresqletcapterror
1条回答
网友
1楼 · 发布于 2024-05-04 19:54:53

您使用了错误的PGDG存储库:

deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main

此包源代码用于Debian jessie发行版,但您的系统使用glibc 2.23-0ubuntu10。这表明您的映像是一个Ubuntu xenial安装,因此您应该改用此映像:

deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main

相关问题 更多 >