Skip to content

Commit c7e1354

Browse files
committed
Sync with latest changes in openshift/postgresql
1 parent b32773a commit c7e1354

File tree

4 files changed

+42
-15
lines changed

4 files changed

+42
-15
lines changed

Diff for: Dockerfile

+28-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM centos:centos7
2-
MAINTAINER Martin Nagy <[email protected]>
32

43
# PostgreSQL image for OpenShift.
54
# Volumes:
@@ -11,11 +10,16 @@ MAINTAINER Martin Nagy <[email protected]>
1110
# * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres'
1211
# PostgreSQL administrative account
1312

14-
# Image metadata
15-
ENV POSTGRESQL_VERSION 9.2
16-
ENV IMAGE_DESCRIPTION PostgreSQL 9.2
17-
ENV IMAGE_TAGS postgresql,postgresql92
18-
ENV IMAGE_EXPOSE_SERVICES 5432:postgresql
13+
MAINTAINER SoftwareCollections.org <[email protected]>
14+
15+
ENV POSTGRESQL_VERSION=9.2 \
16+
HOME=/var/lib/pgsql \
17+
PGUSER=postgres
18+
19+
LABEL io.k8s.description="PostgreSQL is an advanced Object-Relational database management system" \
20+
io.k8s.display-name="PostgreSQL 9.2" \
21+
io.openshift.expose-services="5432:postgresql" \
22+
io.openshift.tags="database,postgresql,postgresql92"
1923

2024
EXPOSE 5432
2125

@@ -24,17 +28,31 @@ EXPOSE 5432
2428
# to make sure of that.
2529
RUN rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
2630
yum -y --setopt=tsflags=nodocs install https://www.softwarecollections.org/en/scls/rhscl/postgresql92/epel-7-x86_64/download/rhscl-postgresql92-epel-7-x86_64.noarch.rpm && \
27-
yum -y --setopt=tsflags=nodocs install gettext postgresql92 && \
31+
yum -y --setopt=tsflags=nodocs --enablerepo=centosplus install gettext bind-utils postgresql92 epel-release && \
32+
yum -y --setopt=tsflags=nodocs install nss_wrapper && \
2833
yum clean all && \
34+
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
2935
mkdir -p /var/lib/pgsql/data && chown postgres.postgres /var/lib/pgsql/data && \
30-
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)"
36+
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \
37+
# Loosen permission bits to avoid problems running container with arbitrary UID
38+
chmod -R a+rwx /var/run/postgresql
3139

32-
COPY run-postgresql.sh /usr/local/bin/
40+
COPY run-*.sh /usr/local/bin/
3341
COPY contrib /var/lib/pgsql/
3442

43+
# Loosen permission bits to avoid problems running container with arbitrary UID
44+
RUN chmod -R a+rwx /var/lib/pgsql
45+
46+
# When bash is started non-interactively, to run a shell script, for example it
47+
# looks for this variable and source the content of this file. This will enable
48+
# the SCL for all scripts without need to do 'scl enable'.
49+
ENV BASH_ENV=/var/lib/pgsql/scl_enable \
50+
ENV=/var/lib/pgsql/scl_enable \
51+
PROMPT_COMMAND=". /var/lib/pgsql/scl_enable"
52+
3553
VOLUME ["/var/lib/pgsql/data"]
3654

37-
USER postgres
55+
USER 26
3856

3957
ENTRYPOINT ["run-postgresql.sh"]
4058
CMD ["postgres"]

Diff for: contrib/.bashrc

-2
This file was deleted.

Diff for: contrib/openshift-custom-postgresql.conf.template

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
22
# Custom OpenShift configuration.
33
#
4-
# NOTE: This file is rewritten everytime the container is started!
5-
# Changes to this file will be overrwritten.
4+
# NOTE: This file is rewritten every time the container is started!
5+
# Changes to this file will be overwritten.
66
#
77

88
# Listen on all interfaces.
@@ -11,5 +11,16 @@ listen_addresses = '*'
1111
# Determines the maximum number of concurrent connections to the database server. Default: 100
1212
max_connections = ${POSTGRESQL_MAX_CONNECTIONS}
1313

14+
# Allow each connection to use a prepared transaction
15+
max_prepared_transactions = ${POSTGRESQL_MAX_CONNECTIONS}
16+
1417
# Sets the amount of memory the database server uses for shared memory buffers. Default: 32MB
1518
shared_buffers = ${POSTGRESQL_SHARED_BUFFERS}
19+
20+
# required on master for replication
21+
wal_level = hot_standby # minimal, archive, hot_standby, or logical
22+
max_wal_senders = 6 # max number of walsender processes
23+
wal_keep_segments = 400 # in logfile segments, 16MB each; 0 disables
24+
25+
# required on replicas for replication
26+
hot_standby = on

Diff for: run-postgresql-master.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ fi
1515
set_passwords
1616

1717
unset_env_vars
18-
exec postgres "$@"
18+
exec postgres "$@"

0 commit comments

Comments
 (0)