Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bb68c34

Browse files
committed
Regenerate scripts
1 parent 38aebc6 commit bb68c34

File tree

21 files changed

+982
-47
lines changed

21 files changed

+982
-47
lines changed

‎11/Dockerfile.c8s‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM
2+
3+
# PostgreSQL image for OpenShift.
4+
# Volumes:
5+
# * /var/lib/pgsql/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 POSTGRESQL_VERSION=11 \
14+
POSTGRESQL_PREV_VERSION=10 \
15+
HOME=/var/lib/pgsql \
16+
PGUSER=postgres \
17+
APP_DATA=/opt/app-root
18+
19+
ENV SUMMARY="PostgreSQL is an advanced Object-Relational database management system" \
20+
DESCRIPTION="PostgreSQL is an advanced Object-Relational database management system (DBMS). \
21+
The image contains the client and server programs that you'll need to \
22+
create, run, maintain and access a PostgreSQL DBMS server."
23+
24+
LABEL summary="$SUMMARY" \
25+
description="$DESCRIPTION" \
26+
io.k8s.description="$DESCRIPTION" \
27+
io.k8s.display-name="PostgreSQL 11" \
28+
io.openshift.expose-services="5432:postgresql" \
29+
io.openshift.tags="" \
30+
io.openshift.s2i.assemble-user="26" \
31+
name="" \
32+
com.redhat.component="" \
33+
version="1" \
34+
usage="podman run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 " \
35+
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
36+
37+
EXPOSE 5432
38+
39+
COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions
40+
41+
# This image must forever use UID 26 for postgres user so our volumes are
42+
# safe in the future. This should *never* change, the last test is there
43+
# to make sure of that.
44+
RUN
45+
INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper " && \
46+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
47+
rpm -V $INSTALL_PKGS && \
48+
yum -y clean all --enablerepo='*' && \
49+
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
50+
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \
51+
mkdir -p /var/lib/pgsql/data && \
52+
/usr/libexec/fix-permissions /var/lib/pgsql /var/run/postgresql
53+
54+
# Get prefix path and path to scripts rather than hard-code them in scripts
55+
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \
56+
ENABLED_COLLECTIONS=
57+
58+
COPY root /
59+
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
60+
61+
# Not using VOLUME statement since it's not working in OpenShift Online:
62+
# https://github.com/sclorg/httpd-container/issues/30
63+
# VOLUME ["/var/lib/pgsql/data"]
64+
65+
# S2I permission fixes
66+
# --------------------
67+
# 1. unless specified otherwise (or - equivalently - we are in OpenShift), s2i
68+
# build process would be executed as 'uid=26(postgres) gid=26(postgres)'.
69+
# Such process wouldn't be able to execute the default 'assemble' script
70+
# correctly (it transitively executes 'fix-permissions' script). So let's
71+
# add the 'postgres' user into 'root' group here
72+
#
73+
# 2. we call fix-permissions on $APP_DATA here directly (UID=0 during build
74+
# anyways) to assure that s2i process is actually able to _read_ the
75+
# user-specified scripting.
76+
RUN usermod -a -G root postgres && \
77+
/usr/libexec/fix-permissions --read-only "$APP_DATA"
78+
79+
USER 26
80+
81+
ENTRYPOINT ["container-entrypoint"]
82+
CMD ["run-postgresql"]

‎11/Dockerfile.c9s‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM
2+
3+
# PostgreSQL image for OpenShift.
4+
# Volumes:
5+
# * /var/lib/pgsql/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 POSTGRESQL_VERSION=11 \
14+
POSTGRESQL_PREV_VERSION=10 \
15+
HOME=/var/lib/pgsql \
16+
PGUSER=postgres \
17+
APP_DATA=/opt/app-root
18+
19+
ENV SUMMARY="PostgreSQL is an advanced Object-Relational database management system" \
20+
DESCRIPTION="PostgreSQL is an advanced Object-Relational database management system (DBMS). \
21+
The image contains the client and server programs that you'll need to \
22+
create, run, maintain and access a PostgreSQL DBMS server."
23+
24+
LABEL summary="$SUMMARY" \
25+
description="$DESCRIPTION" \
26+
io.k8s.description="$DESCRIPTION" \
27+
io.k8s.display-name="PostgreSQL 11" \
28+
io.openshift.expose-services="5432:postgresql" \
29+
io.openshift.tags="" \
30+
io.openshift.s2i.assemble-user="26" \
31+
name="" \
32+
com.redhat.component="" \
33+
version="1" \
34+
usage="podman run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 " \
35+
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
36+
37+
EXPOSE 5432
38+
39+
COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions
40+
41+
# This image must forever use UID 26 for postgres user so our volumes are
42+
# safe in the future. This should *never* change, the last test is there
43+
# to make sure of that.
44+
RUN
45+
INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper " && \
46+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
47+
rpm -V $INSTALL_PKGS && \
48+
yum -y clean all --enablerepo='*' && \
49+
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
50+
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \
51+
mkdir -p /var/lib/pgsql/data && \
52+
/usr/libexec/fix-permissions /var/lib/pgsql /var/run/postgresql
53+
54+
# Get prefix path and path to scripts rather than hard-code them in scripts
55+
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \
56+
ENABLED_COLLECTIONS=
57+
58+
COPY root /
59+
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
60+
61+
# Not using VOLUME statement since it's not working in OpenShift Online:
62+
# https://github.com/sclorg/httpd-container/issues/30
63+
# VOLUME ["/var/lib/pgsql/data"]
64+
65+
# S2I permission fixes
66+
# --------------------
67+
# 1. unless specified otherwise (or - equivalently - we are in OpenShift), s2i
68+
# build process would be executed as 'uid=26(postgres) gid=26(postgres)'.
69+
# Such process wouldn't be able to execute the default 'assemble' script
70+
# correctly (it transitively executes 'fix-permissions' script). So let's
71+
# add the 'postgres' user into 'root' group here
72+
#
73+
# 2. we call fix-permissions on $APP_DATA here directly (UID=0 during build
74+
# anyways) to assure that s2i process is actually able to _read_ the
75+
# user-specified scripting.
76+
RUN usermod -a -G root postgres && \
77+
/usr/libexec/fix-permissions --read-only "$APP_DATA"
78+
79+
USER 26
80+
81+
ENTRYPOINT ["container-entrypoint"]
82+
CMD ["run-postgresql"]

‎11/Dockerfile.fedora‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM quay.io/fedora/s2i-core:35
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+
ARCH=x86_64 \
16+
\
17+
POSTGRESQL_VERSION=11 \
18+
POSTGRESQL_PREV_VERSION=10 \
19+
HOME=/var/lib/pgsql \
20+
PGUSER=postgres \
21+
APP_DATA=/opt/app-root
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 11" \
32+
io.openshift.expose-services="5432:postgresql" \
33+
io.openshift.tags="database,postgresql,postgresql11" \
34+
com.redhat.component="$NAME" \
35+
maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
36+
name="fedora/$NAME-11" \
37+
version="0" \
38+
usage="docker run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 quay.io/fedora/$NAME-11"
39+
40+
EXPOSE 5432
41+
42+
COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions
43+
44+
# This image must forever use UID 26 for postgres user so our volumes are
45+
# safe in the future. This should *never* change, the last test is there
46+
# to make sure of that.
47+
RUN INSTALL_PKGS="rsync tar gettext bind-utils postgresql-server postgresql-contrib nss_wrapper " && \
48+
INSTALL_PKGS+="findutils xz" && \
49+
dnf -y module enable postgresql:11 && \
50+
dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
51+
rpm -V $INSTALL_PKGS && \
52+
dnf clean all && \
53+
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \
54+
mkdir -p /var/lib/pgsql/data && \
55+
/usr/libexec/fix-permissions /var/lib/pgsql /var/run/postgresql
56+
57+
# Get prefix path and path to scripts rather than hard-code them in scripts
58+
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql
59+
60+
COPY root /
61+
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
62+
63+
VOLUME ["/var/lib/pgsql/data"]
64+
65+
# S2I permission fixes
66+
# --------------------
67+
# 1. unless specified otherwise (or - equivalently - we are in OpenShift), s2i
68+
# build process would be executed as 'uid=26(postgres) gid=26(postgres)'.
69+
# Such process wouldn't be able to execute the default 'assemble' script
70+
# correctly (it transitively executes 'fix-permissions' script). So let's
71+
# add the 'postgres' user into 'root' group here
72+
#
73+
# 2. we call fix-permissions on $APP_DATA here directly (UID=0 during build
74+
# anyways) to assure that s2i process is actually able to _read_ the
75+
# user-specified scripting.
76+
RUN usermod -a -G root postgres && \
77+
/usr/libexec/fix-permissions --read-only "$APP_DATA"
78+
79+
USER 26
80+
81+
ENTRYPOINT ["container-entrypoint"]
82+
CMD ["run-postgresql"]

‎11/Dockerfile.rhel9‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM
2+
3+
# PostgreSQL image for OpenShift.
4+
# Volumes:
5+
# * /var/lib/pgsql/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 POSTGRESQL_VERSION=11 \
14+
POSTGRESQL_PREV_VERSION=10 \
15+
HOME=/var/lib/pgsql \
16+
PGUSER=postgres \
17+
APP_DATA=/opt/app-root
18+
19+
ENV SUMMARY="PostgreSQL is an advanced Object-Relational database management system" \
20+
DESCRIPTION="PostgreSQL is an advanced Object-Relational database management system (DBMS). \
21+
The image contains the client and server programs that you'll need to \
22+
create, run, maintain and access a PostgreSQL DBMS server."
23+
24+
LABEL summary="$SUMMARY" \
25+
description="$DESCRIPTION" \
26+
io.k8s.description="$DESCRIPTION" \
27+
io.k8s.display-name="PostgreSQL 11" \
28+
io.openshift.expose-services="5432:postgresql" \
29+
io.openshift.tags="" \
30+
io.openshift.s2i.assemble-user="26" \
31+
name="" \
32+
com.redhat.component="" \
33+
version="1" \
34+
usage="podman run -d --name postgresql_database -e POSTGRESQL_USER=user -e POSTGRESQL_PASSWORD=pass -e POSTGRESQL_DATABASE=db -p 5432:5432 " \
35+
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
36+
37+
EXPOSE 5432
38+
39+
COPY root/usr/libexec/fix-permissions /usr/libexec/fix-permissions
40+
41+
# This image must forever use UID 26 for postgres user so our volumes are
42+
# safe in the future. This should *never* change, the last test is there
43+
# to make sure of that.
44+
RUN
45+
INSTALL_PKGS="rsync tar gettext bind-utils nss_wrapper " && \
46+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
47+
rpm -V $INSTALL_PKGS && \
48+
yum -y clean all --enablerepo='*' && \
49+
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
50+
test "$(id postgres)" = "uid=26(postgres) gid=26(postgres) groups=26(postgres)" && \
51+
mkdir -p /var/lib/pgsql/data && \
52+
/usr/libexec/fix-permissions /var/lib/pgsql /var/run/postgresql
53+
54+
# Get prefix path and path to scripts rather than hard-code them in scripts
55+
ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql \
56+
ENABLED_COLLECTIONS=
57+
58+
COPY root /
59+
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
60+
61+
# Not using VOLUME statement since it's not working in OpenShift Online:
62+
# https://github.com/sclorg/httpd-container/issues/30
63+
# VOLUME ["/var/lib/pgsql/data"]
64+
65+
# S2I permission fixes
66+
# --------------------
67+
# 1. unless specified otherwise (or - equivalently - we are in OpenShift), s2i
68+
# build process would be executed as 'uid=26(postgres) gid=26(postgres)'.
69+
# Such process wouldn't be able to execute the default 'assemble' script
70+
# correctly (it transitively executes 'fix-permissions' script). So let's
71+
# add the 'postgres' user into 'root' group here
72+
#
73+
# 2. we call fix-permissions on $APP_DATA here directly (UID=0 during build
74+
# anyways) to assure that s2i process is actually able to _read_ the
75+
# user-specified scripting.
76+
RUN usermod -a -G root postgres && \
77+
/usr/libexec/fix-permissions --read-only "$APP_DATA"
78+
79+
USER 26
80+
81+
ENTRYPOINT ["container-entrypoint"]
82+
CMD ["run-postgresql"]

‎11/root/usr/share/container-scripts/postgresql/README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ initialization by passing `-e VAR=VALUE` to the Docker run command.
7474
**`POSTGRESQL_ADMIN_PASSWORD`**
7575
Password for the `postgres` admin account (optional)
7676

77+
The following environment variables are optional, and only used when the database is initialzed
78+
79+
**`POSTGRESQL_ENCODING`**
80+
Database encoding. Default to UTF8
81+
82+
**`POSTGRESQL_LOCALE`**
83+
Database locale. Default to en_US
7784

7885
Alternatively, the following options are related to migration scenario:
7986

‎11/root/usr/share/container-scripts/postgresql/common.sh‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ initdb_wrapper ()
189189
# Initialize the database cluster with utf8 support enabled by default.
190190
# This might affect performance, see:
191191
# http://www.postgresql.org/docs/11/static/locale.html
192-
LANG=${LANG:-en_US.utf8} "$@"
192+
ENCODING=${POSTGRESQL_ENCODING:-UTF8}
193+
LOCALE=${POSTGRESQL_LOCALE:-en_US}
194+
if [ ${LOCALE} == "C" ] ; then LANG=C; fi
195+
LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING
193196
}
194197

195198
function initialize_database() {
@@ -222,7 +225,16 @@ EOF
222225
function create_users() {
223226
if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then
224227
createuser "$POSTGRESQL_USER"
225-
createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE"
228+
229+
EXTRA_ARGS=""
230+
if [ -v POSTGRESQL_ENCODING ]; then
231+
EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING"
232+
fi
233+
if [ -v POSTGRESQL_LOCALE ]; then
234+
EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE"
235+
fi
236+
237+
createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE"
226238
fi
227239

228240
if [ -v POSTGRESQL_MASTER_USER ]; then

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /