【问题标题】:Dockerfile upgrade postgresql 10 python errorDockerfile升级postgresql 10 python报错
【发布时间】:2018-10-01 10:34:39
【问题描述】:
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:错误处理包python3.5-minimal(--configure): 子进程安装后安装脚本返回错误退出 状态 134 dpkg:依赖问题阻止配置 python3-minimal:python3-minimal 依赖于 python3.5-minimal (>= 3.5.1-2~);但是:尚未配置包 python3.5-minimal。

dpkg:错误处理包python3-minimal(--configure): 依赖性问题 - 留下未配置的处理触发器 libc-bin (2.23-0ubuntu10) ... 时遇到错误 处理:python3.5-minimal python3-minimal E:子进程 /usr/bin/dpkg 返回错误代码 (1)

【问题讨论】:

  • 你的基础镜像是什么?你没有提到FROM 这一行。
  • 基础镜像是ubuntu
  • ubuntu 图像不是 xenial,因此它不像您的示例那样使用 glibc 2.23。请告诉我们您使用的FROM 线路。
  • 好的,我应该使用 debian 基础镜像吗?尝试使用这个:FROM gcr.io/google-appengine/debian9 请告诉我需要进行哪些更改。
  • 更喜欢 Debian,但这真的取决于你做什么。关键是基础镜像必须与您启用并用于安装 PostgreSQL 的 PGDG 存储库一致。

标签: python dockerfile


【解决方案1】:

您使用了错误的 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

【讨论】:

  • 不幸的是还是同样的问题。 :(
  • 请指教,我应该使用哪个基础镜像?
猜你喜欢
  • 2020-12-15
  • 1970-01-01
  • 2013-12-19
  • 2018-12-30
  • 1970-01-01
  • 2015-10-25
  • 2018-12-13
  • 2016-07-27
  • 2016-03-31
相关资源
最近更新 更多