diff options
| author | Devrim Gündüz | 2017-01-18 17:50:36 +0000 |
|---|---|---|
| committer | Devrim Gündüz | 2017-01-18 17:50:36 +0000 |
| commit | bb0bebbe847a5676e28368f4aaed3560e4538058 (patch) | |
| tree | 6e5628095785da00f6e5010d018458b540bf7cb4 /docker | |
| parent | 2f919f3918884ca5f8f04fe818a7bbfb0dec9f03 (diff) | |
docker: Update/fix CentOS 7 Dockerfile
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/Dockerfile-CentOS7-PG95 | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/docker/Dockerfile-CentOS7-PG95 b/docker/Dockerfile-CentOS7-PG95 index 5e818318c..912e41d3a 100644 --- a/docker/Dockerfile-CentOS7-PG95 +++ b/docker/Dockerfile-CentOS7-PG95 @@ -1,46 +1,46 @@ ######################################################################### -# # -# Dockerfile for CentOS PostgreSQL Spin, with PGDG packages. # -# Devrim GUNDUZ <[email protected]> # -# # +# # +# Dockerfile for Fedora PostgreSQL Spin, with PGDG RPM packages. # +# Devrim Gündüz <[email protected]> # +# # ######################################################################### FROM centos:latest MAINTAINER [email protected] # Add the PostgreSQL PGP key to verify the official yum repository packages -RUN rpm --import http://yum.postgresql.org/RPM-GPG-KEY-PGDG-95 +RUN rpm --import https://yum.postgresql.org/RPM-GPG-KEY-PGDG-96 # Add PostgreSQL's repository. It contains the most recent stable release -# of PostgreSQL, ``9.5``. -RUN rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm +# of PostgreSQL, 9.6: +RUN yum -q -y install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm -# Update the CentOS and PostgreSQL repository metadata -RUN yum -y install deltarpm -RUN yum update -y +# Update the Fedora and PostgreSQL repository metadata +RUN yum -q -y install deltarpm +RUN yum -q -y update -# Install PostgreSQL 9.5 -RUN yum -y -q install postgresql95-server postgresql95-client +# Install PostgreSQL 9.6 and some useful packages: +RUN yum -q -y install postgresql96-server postgresql96-contrib procps-ng net-tools -# initdb PostgreSQL 9.5: -RUN /usr/pgsql-9.5/bin/postgresql95-setup initdb +# Run the rest of the commands as the postgres user created by the postgresql96-server +# package when it was yum installed +USER postgres + +# initdb PostgreSQL 9.6: +RUN /usr/pgsql-9.6/bin/initdb -D /var/lib/pgsql/9.6/data -A trust 2>&1 < /dev/null # Adjust PostgreSQL configuration so that remote connections to the # database are possible. -RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/9.5/data/pg_hba.conf +RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/9.6/data/pg_hba.conf -# And add ``listen_addresses`` to ``/var/lib/pgsql/9.5/data/postgresql.conf`` -RUN echo "listen_addresses='*'" >> /var/lib/pgsql/9.5/data/postgresql.conf - -# Run the rest of the commands as the ``postgres`` user created by the ``postgresql95-server`` -# package when it was ``yum installed`` -USER postgres +# And add listen_addresses to /var/lib/pgsql/9.6/data/postgresql.conf +RUN echo "listen_addresses='*'" >> /var/lib/pgsql/9.6/data/postgresql.conf -# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and -# then create a database `docker` owned by the ``docker`` role. +# Create a PostgreSQL role named 'docker' with 'docker' as the password and +# then create a database 'docker' owned by the 'docker' role. # After start, sleep for 5 secs to make sure that postmaster is started before -# creaiting the role and database: -RUN /usr/pgsql-9.5/bin/pg_ctl -D /var/lib/pgsql/9.5/data start &&\ +# creating the role and database: +RUN /usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/9.6/data start &&\ sleep 5 &&\ psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\ createdb -O docker docker @@ -49,7 +49,7 @@ RUN /usr/pgsql-9.5/bin/pg_ctl -D /var/lib/pgsql/9.5/data start &&\ EXPOSE 5432 # Add VOLUMEs to allow backup of config, logs and databases -VOLUME ["/var/lib/pgsql/9.5"] +VOLUME ["/var/lib/pgsql/9.6"] # Set the default command to run when starting the container -CMD ["/usr/pgsql-9.5/bin/postgres", "-D", "/var/lib/pgsql/9.5/data"] +CMD ["/usr/pgsql-9.6/bin/postgres", "-D", "/var/lib/pgsql/9.6/data"] |
