Hello, I try to create a docker who reproduce my production environment in Centos 6 + postgresql 9.4, this is my Dockerfile writed on the same model as found in docker documentation for ubuntu + postgresql 9.3 and modified for my environment
FROM centos:centos6
RUN yum -y update; yum clean all
RUN yum -y install epel-release; yum clean all
RUN rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-3.noarch.rpm
RUN yum -y update; yum clean all
RUN yum -y install postgresql94-server postgresql94-contrib postgresql94-devel; yum clean all
RUN service postgresql-9.4 initdb
USER postgres
RUN service postgresql-9.4 start &&
psql --command “CREATE USER docker WITH SUPERUSER PASSWORD ‘docker’;” &&
createdb -O docker dockerdb
RUN echo “host all all 0.0.0.0/0 md5” >> /var/lib/pgsql/9.4/data/pg_hba.conf
RUN echo “listen_addresses=‘*’” >> /var/lib/pgsql/9.4/data/postgresql.conf
EXPOSE 5432
And this is my problem, postgresql-9.4 service doesn’t start
Step 8 : RUN service postgresql-9.4 start && psql --command “CREATE USER docker WITH SUPERUSER PASSWORD ‘docker’;” && createdb -O docker crmmbqt
—> Running in 2316099498ba
Starting postgresql-9.4 service: [FAILED]
The command ‘/bin/sh -c service postgresql-9.4 start && psql --command “CREATE USER docker WITH SUPERUSER PASSWORD ‘docker’;” && createdb -O docker crmmbqt’ returned a non-zero code: 1
I need your help, thanks by advance.