|
| 1 | +FROM registry.fedoraproject.org/f26/s2i-base:latest |
| 2 | + |
| 3 | +# PostgreSQL image for OpenShift. |
| 4 | +# Volumes: |
| 5 | +# * /var/lib/psql/data - Database cluster for PostgreSQL |
| 6 | +# Environment: |
| 7 | +# * $POSTGRESQL_USER - Database user name |
| 8 | +# * $POSTGRESQL_PASSWORD - User's password |
| 9 | +# * $POSTGRESQL_DATABASE - Name of the database to create |
| 10 | +# * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' |
| 11 | +# PostgreSQL administrative account |
| 12 | + |
| 13 | +ENV NAME=postgresql \ |
| 14 | + VERSION=0 \ |
| 15 | + RELEASE=1 \ |
| 16 | + ARCH=x86_64 \ |
| 17 | + \ |
| 18 | + POSTGRESQL_VERSION=9.6 \ |
| 19 | + POSTGRESQL_PREV_VERSION=9.5 \ |
| 20 | + HOME=/var/lib/pgsql \ |
| 21 | + PGUSER=postgres |
| 22 | + |
| 23 | +ENV SUMMARY="PostgreSQL is an advanced Object-Relational database management system" \ |
| 24 | + DESCRIPTION="PostgreSQL is an advanced Object-Relational database management system (DBMS). \ |
| 25 | +The image contains the client and server programs that you'll need to \ |
| 26 | +create, run, maintain and access a PostgreSQL DBMS server." |
| 27 | + |
| 28 | +LABEL summary=$SUMMARY \ |
| 29 | + description="$DESCRIPTION" \ |
| 30 | + io.k8s.description="$DESCRIPTION" \ |
| 31 | + io.k8s.display-name="PostgreSQL 9.6" \ |
| 32 | + io.openshift.expose-services="5432:postgresql" \ |
| 33 | + io.openshift.tags="database,postgresql,postgresql96" \ |
| 34 | + com.redhat.component="$NAME" \ |
| 35 | + maintainer="SoftwareCollections.org < [email protected]>" \ |
| 36 | + name="$FCG/$NAME" \ |
| 37 | + version="0" \ |
| 38 | + release="$RELEASE.$DISTTAG" \ |
| 39 | + architecture="$ARCH" \ |
| 40 | + usage="docker run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 $FGC/$NAME" \ |
| 41 | + help="/help.1" |
| 42 | + |
| 43 | +EXPOSE 5432 |
| 44 | + |
| 45 | +ADD root / |
| 46 | + |
| 47 | +# This image must forever use UID 26 for postgres user so our volumes are |
| 48 | +# safe in the future. This should *never* change, the last test is there |
| 49 | +# to make sure of that. |
| 50 | +RUN INSTALL_PKGS="rsync tar gettext bind-utils postgresql-server postgresql-contrib nss_wrapper " && \ |
| 51 | + INSTALL_PKGS+="findutils python2 " && \ |
| 52 | + dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ |
| 53 | + rpm -V $INSTALL_PKGS && \ |
| 54 | + dnf clean all && \ |
| 55 | + test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \ |
| 56 | + mkdir -p /var/lib/pgsql/data && \ |
| 57 | + /usr/libexec/fix-permissions /var/lib/pgsql && \ |
| 58 | + /usr/libexec/fix-permissions /var/run/postgresql |
| 59 | + |
| 60 | +# Get prefix path and path to scripts rather than hard-code them in scripts |
| 61 | +ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql |
| 62 | + |
| 63 | +VOLUME ["/var/lib/pgsql/data"] |
| 64 | + |
| 65 | +USER 26 |
| 66 | + |
| 67 | +ENTRYPOINT ["container-entrypoint"] |
| 68 | +CMD ["run-postgresql"] |
0 commit comments