我試圖建立與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