1
1
FROM centos:centos7
2
- MAINTAINER Martin Nagy <
[email protected] >
3
2
4
3
# PostgreSQL image for OpenShift.
5
4
# Volumes:
11
10
# * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres'
12
11
# PostgreSQL administrative account
13
12
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"
19
23
20
24
EXPOSE 5432
21
25
@@ -24,17 +28,31 @@ EXPOSE 5432
24
28
# to make sure of that.
25
29
RUN rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
26
30
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 && \
28
33
yum clean all && \
34
+ localedef -f UTF-8 -i en_US en_US.UTF-8 && \
29
35
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
31
39
32
- COPY run-postgresql .sh /usr/local/bin/
40
+ COPY run-* .sh /usr/local/bin/
33
41
COPY contrib /var/lib/pgsql/
34
42
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
+
35
53
VOLUME ["/var/lib/pgsql/data" ]
36
54
37
- USER postgres
55
+ USER 26
38
56
39
57
ENTRYPOINT ["run-postgresql.sh" ]
40
58
CMD ["postgres" ]
0 commit comments