postgresql - 在 centos docker 图像上初始化 postgres 失败,无法获得 D-Bus 连接 : Operation not permitted

标签 postgresql docker centos

我正在尝试在 docker 镜像上安装 postgres,基础镜像正在运行 centos。

我正在按照 How to Install PostgreSQL Relational Databases on CentOS 7 中的说明进行操作这是我的 Dockerfile:

FROM our-internal-docker-registry.org/centos:7.3.1611
RUN yum install -y postgresql-server postgresql-contrib
RUN postgresql-setup initdb

第一个 RUN 命令成功,但第二个失败:

Step 3/3 : RUN postgresql-setup initdb
 ---> Running in d26f43467aa0
Failed to get D-Bus connection: Operation not permitted
failed to find PGDATA setting in postgresql.service
The command '/bin/sh -c postgresql-setup initdb' returned a non-zero code: 1

我承认我对下一步做什么一无所知,因为我对 postgres 或 linux 不是很熟悉。希望得到一些建议。

最佳答案

“D-Bus connection: Operation not permitted”暗示它想要联系 SystemD 守护进程。我在 centos 上使用 postgres 以及 https://github.com/gdraheim/docker-systemctl-replacement避免这种情况。

关于postgresql - 在 centos docker 图像上初始化 postgres 失败,无法获得 D-Bus 连接 : Operation not permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46494668/

相关文章:

postgresql - 在 postgres 数据库中保存文件树的最简单方法是什么?

java - java liferay项目中的内存泄漏

database - docker-compose 与多个数据库

postgresql - 用yum安装pgadmin3 centos 6

python - 程序停止运行是由python udp 停留在一个地方引起的

postgresql - 使用 postgres test-app 从 Grails 2.1.0 升级到 2.3.7 正在中断

预定义值的 SQL 结果表

windows - 我在Windows上进行开发,而我的产品在Linux上进行开发,如何正确处理docker-compose文件?

docker - 在 docker 容器中通过桥接时无法访问 SSL IP。获取 SSL_ERROR_SYSCALL

java - 在centos for java上安装opencv