我试图建立与Centos7和PostgreSQL 9.6码头工人的形象。PostgreSQL的9.6 initdb的CentOS中7搬运工容器失败
我使用CentOS的:centos7图像为基础,因此我遵循此页面的步骤:https://wiki.postgresql.org/wiki/YUM_Installation
初始化DB
sh-4.2# /usr/pgsql-9.6/bin/postgresql96-setup initdb
Failed to get D-Bus connection: Operation not permitted
failed to find PGDATA setting in postgresql-9.6.service
的一步,我试图按照以下步骤启用systemd对于CentOS映像, https://hub.docker.com/_/centos/ 但它没有帮助。
我也试过在postgresql96-setup脚本
#PGDATA=`systemctl show -p Environment "${SERVICE_NAME}.service" |
# sed 's/^Environment=//' | tr ' ' '\n' |
# sed -n 's/^PGDATA=//p' | tail -n 1`
#if [ x"$PGDATA" = x ]; then
# echo "failed to find PGDATA setting in ${SERVICE_NAME}.service"
# exit 1
#fi
现在initdb的作品注释掉中的支柱。但开始服务给我同样的错误信息
sh-4.2# systemctl enable postgresql-9.6.service
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-9.6.service to /usr/lib/systemd/system/postgresql-9.6.service.
sh-4.2# systemctl start postgresql-9.6.service
Failed to get D-Bus connection: Operation not permitted
我错过了什么吗?任何人都可以帮我解决这个问题吗?
你不能使用官方postgres图片https://hub.docker.com/_/postgres/ – Rao
@Rao我有同样的问题。你链接到的不是Centos7。 CentOS 7版本没有“最新”版本。他们链接到的是9.5,而不是9.6,并且未安装为超级安装的根目录:https://hub.docker.com/r/centos/postgresql-95-centos7/ – nealmcb
这似乎很可能是路由到'无法获得D-Bus连接:不允许操作'的解决方案:https://serverfault.com/questions/824975/failed-to-get-d-bus-connection-operation-not- permit – nealmcb