I'm trying to install postgres on a docker image, base image is running centos.
I'm following instructions at How to Install PostgreSQL Relational Databases on CentOS 7 and here's my Dockerfile:
FROM our-internal-docker-registry.org/centos:7.3.1611
RUN yum install -y postgresql-server postgresql-contrib
RUN postgresql-setup initdb
The first RUN command succeeds however the second one fails with:
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
I admit to being clueless as to what to do next as I'm not very familiar with postgres, or indeed linux. Hoping for some advice.