From 766be9038d62a4480ecda881235ab9f5d8760fb1 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 5 Oct 2023 20:48:52 +0200 Subject: [PATCH] Regenerate scripts/doc --- 10/Dockerfile.rhel8 | 2 ++ .../share/container-scripts/postgresql/common.sh | 16 ++++++++++++++-- 12/Dockerfile.fedora | 2 ++ 12/Dockerfile.rhel8 | 2 ++ .../share/container-scripts/postgresql/common.sh | 16 ++++++++++++++-- 13/Dockerfile.c9s | 2 ++ 13/Dockerfile.fedora | 2 ++ 13/Dockerfile.rhel8 | 2 ++ 13/Dockerfile.rhel9 | 2 ++ .../share/container-scripts/postgresql/common.sh | 16 ++++++++++++++-- 14/Dockerfile.fedora | 2 ++ .../share/container-scripts/postgresql/common.sh | 16 ++++++++++++++-- 15/Dockerfile.c9s | 2 ++ 15/Dockerfile.fedora | 2 ++ 15/Dockerfile.rhel8 | 2 ++ 15/Dockerfile.rhel9 | 2 ++ .../share/container-scripts/postgresql/common.sh | 16 ++++++++++++++-- 16/Dockerfile.c9s | 2 ++ 16/Dockerfile.fedora | 2 ++ 16/Dockerfile.rhel8 | 2 ++ 16/Dockerfile.rhel9 | 2 ++ .../share/container-scripts/postgresql/common.sh | 16 ++++++++++++++-- 22 files changed, 116 insertions(+), 12 deletions(-) diff --git a/10/Dockerfile.rhel8 b/10/Dockerfile.rhel8 index 236e488b..feac4c68 100644 --- a/10/Dockerfile.rhel8 +++ b/10/Dockerfile.rhel8 @@ -9,6 +9,8 @@ FROM ubi8/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=10 \ POSTGRESQL_PREV_VERSION=9.6 \ diff --git a/10/root/usr/share/container-scripts/postgresql/common.sh b/10/root/usr/share/container-scripts/postgresql/common.sh index 0b57e599..567bada4 100644 --- a/10/root/usr/share/container-scripts/postgresql/common.sh +++ b/10/root/usr/share/container-scripts/postgresql/common.sh @@ -201,7 +201,10 @@ initdb_wrapper () # Initialize the database cluster with utf8 support enabled by default. # This might affect performance, see: # http://www.postgresql.org/docs/10/static/locale.html - LANG=${LANG:-en_US.utf8} "$@" + ENCODING=${POSTGRESQL_ENCODING:-UTF8} + LOCALE=${POSTGRESQL_LOCALE:-en_US} + if [ ${LOCALE} == "C" ] ; then LANG=C; fi + LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING } function initialize_database() { @@ -234,7 +237,16 @@ EOF function create_users() { if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then createuser "$POSTGRESQL_USER" - createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" + + EXTRA_ARGS="" + if [ -v POSTGRESQL_ENCODING ]; then + EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING" + fi + if [ -v POSTGRESQL_LOCALE ]; then + EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE" + fi + + createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" fi if [ -v POSTGRESQL_MASTER_USER ]; then diff --git a/12/Dockerfile.fedora b/12/Dockerfile.fedora index afcc8bc9..1f844306 100644 --- a/12/Dockerfile.fedora +++ b/12/Dockerfile.fedora @@ -9,6 +9,8 @@ FROM quay.io/fedora/s2i-core:38 # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV NAME=postgresql \ VERSION=0 \ diff --git a/12/Dockerfile.rhel8 b/12/Dockerfile.rhel8 index c9b76963..48d502f9 100644 --- a/12/Dockerfile.rhel8 +++ b/12/Dockerfile.rhel8 @@ -9,6 +9,8 @@ FROM ubi8/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=12 \ POSTGRESQL_PREV_VERSION=10 \ diff --git a/12/root/usr/share/container-scripts/postgresql/common.sh b/12/root/usr/share/container-scripts/postgresql/common.sh index eff22d87..82843de7 100644 --- a/12/root/usr/share/container-scripts/postgresql/common.sh +++ b/12/root/usr/share/container-scripts/postgresql/common.sh @@ -201,7 +201,10 @@ initdb_wrapper () # Initialize the database cluster with utf8 support enabled by default. # This might affect performance, see: # http://www.postgresql.org/docs/12/static/locale.html - LANG=${LANG:-en_US.utf8} "$@" + ENCODING=${POSTGRESQL_ENCODING:-UTF8} + LOCALE=${POSTGRESQL_LOCALE:-en_US} + if [ ${LOCALE} == "C" ] ; then LANG=C; fi + LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING } function initialize_database() { @@ -234,7 +237,16 @@ EOF function create_users() { if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then createuser "$POSTGRESQL_USER" - createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" + + EXTRA_ARGS="" + if [ -v POSTGRESQL_ENCODING ]; then + EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING" + fi + if [ -v POSTGRESQL_LOCALE ]; then + EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE" + fi + + createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" fi if [ -v POSTGRESQL_MASTER_USER ]; then diff --git a/13/Dockerfile.c9s b/13/Dockerfile.c9s index 075839d2..7e92b4b4 100644 --- a/13/Dockerfile.c9s +++ b/13/Dockerfile.c9s @@ -9,6 +9,8 @@ FROM quay.io/sclorg/s2i-core-c9s:c9s # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=13 \ POSTGRESQL_PREV_VERSION=12 \ diff --git a/13/Dockerfile.fedora b/13/Dockerfile.fedora index 124e1bb2..c9b2089f 100644 --- a/13/Dockerfile.fedora +++ b/13/Dockerfile.fedora @@ -9,6 +9,8 @@ FROM quay.io/fedora/s2i-core:38 # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV NAME=postgresql \ VERSION=0 \ diff --git a/13/Dockerfile.rhel8 b/13/Dockerfile.rhel8 index b6e39c72..b6c74101 100644 --- a/13/Dockerfile.rhel8 +++ b/13/Dockerfile.rhel8 @@ -9,6 +9,8 @@ FROM ubi8/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=13 \ POSTGRESQL_PREV_VERSION=12 \ diff --git a/13/Dockerfile.rhel9 b/13/Dockerfile.rhel9 index a53a917f..74149d44 100644 --- a/13/Dockerfile.rhel9 +++ b/13/Dockerfile.rhel9 @@ -9,6 +9,8 @@ FROM ubi9/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=13 \ POSTGRESQL_PREV_VERSION=12 \ diff --git a/13/root/usr/share/container-scripts/postgresql/common.sh b/13/root/usr/share/container-scripts/postgresql/common.sh index afcfc059..a636808a 100644 --- a/13/root/usr/share/container-scripts/postgresql/common.sh +++ b/13/root/usr/share/container-scripts/postgresql/common.sh @@ -201,7 +201,10 @@ initdb_wrapper () # Initialize the database cluster with utf8 support enabled by default. # This might affect performance, see: # http://www.postgresql.org/docs/13/static/locale.html - LANG=${LANG:-en_US.utf8} "$@" + ENCODING=${POSTGRESQL_ENCODING:-UTF8} + LOCALE=${POSTGRESQL_LOCALE:-en_US} + if [ ${LOCALE} == "C" ] ; then LANG=C; fi + LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING } function initialize_database() { @@ -234,7 +237,16 @@ EOF function create_users() { if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then createuser "$POSTGRESQL_USER" - createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" + + EXTRA_ARGS="" + if [ -v POSTGRESQL_ENCODING ]; then + EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING" + fi + if [ -v POSTGRESQL_LOCALE ]; then + EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE" + fi + + createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" fi if [ -v POSTGRESQL_MASTER_USER ]; then diff --git a/14/Dockerfile.fedora b/14/Dockerfile.fedora index 888ebc88..16204396 100644 --- a/14/Dockerfile.fedora +++ b/14/Dockerfile.fedora @@ -9,6 +9,8 @@ FROM quay.io/fedora/s2i-core:38 # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV NAME=postgresql \ VERSION=0 \ diff --git a/14/root/usr/share/container-scripts/postgresql/common.sh b/14/root/usr/share/container-scripts/postgresql/common.sh index b2b7b762..971d8fae 100644 --- a/14/root/usr/share/container-scripts/postgresql/common.sh +++ b/14/root/usr/share/container-scripts/postgresql/common.sh @@ -201,7 +201,10 @@ initdb_wrapper () # Initialize the database cluster with utf8 support enabled by default. # This might affect performance, see: # http://www.postgresql.org/docs/14/static/locale.html - LANG=${LANG:-en_US.utf8} "$@" + ENCODING=${POSTGRESQL_ENCODING:-UTF8} + LOCALE=${POSTGRESQL_LOCALE:-en_US} + if [ ${LOCALE} == "C" ] ; then LANG=C; fi + LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING } function initialize_database() { @@ -234,7 +237,16 @@ EOF function create_users() { if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then createuser "$POSTGRESQL_USER" - createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" + + EXTRA_ARGS="" + if [ -v POSTGRESQL_ENCODING ]; then + EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING" + fi + if [ -v POSTGRESQL_LOCALE ]; then + EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE" + fi + + createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" fi if [ -v POSTGRESQL_MASTER_USER ]; then diff --git a/15/Dockerfile.c9s b/15/Dockerfile.c9s index 25ab942f..81206847 100644 --- a/15/Dockerfile.c9s +++ b/15/Dockerfile.c9s @@ -9,6 +9,8 @@ FROM quay.io/sclorg/s2i-core-c9s:c9s # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=15 \ POSTGRESQL_PREV_VERSION=13 \ diff --git a/15/Dockerfile.fedora b/15/Dockerfile.fedora index 130f7cca..106135ba 100644 --- a/15/Dockerfile.fedora +++ b/15/Dockerfile.fedora @@ -9,6 +9,8 @@ FROM quay.io/fedora/s2i-core:38 # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV NAME=postgresql \ VERSION=0 \ diff --git a/15/Dockerfile.rhel8 b/15/Dockerfile.rhel8 index 09304483..b6f5b25a 100644 --- a/15/Dockerfile.rhel8 +++ b/15/Dockerfile.rhel8 @@ -9,6 +9,8 @@ FROM ubi8/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=15 \ POSTGRESQL_PREV_VERSION=13 \ diff --git a/15/Dockerfile.rhel9 b/15/Dockerfile.rhel9 index 23566a5b..562d1611 100644 --- a/15/Dockerfile.rhel9 +++ b/15/Dockerfile.rhel9 @@ -9,6 +9,8 @@ FROM ubi9/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=15 \ POSTGRESQL_PREV_VERSION=13 \ diff --git a/15/root/usr/share/container-scripts/postgresql/common.sh b/15/root/usr/share/container-scripts/postgresql/common.sh index be2eb759..fa080609 100644 --- a/15/root/usr/share/container-scripts/postgresql/common.sh +++ b/15/root/usr/share/container-scripts/postgresql/common.sh @@ -201,7 +201,10 @@ initdb_wrapper () # Initialize the database cluster with utf8 support enabled by default. # This might affect performance, see: # http://www.postgresql.org/docs/15/static/locale.html - LANG=${LANG:-en_US.utf8} "$@" + ENCODING=${POSTGRESQL_ENCODING:-UTF8} + LOCALE=${POSTGRESQL_LOCALE:-en_US} + if [ ${LOCALE} == "C" ] ; then LANG=C; fi + LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING } function initialize_database() { @@ -234,7 +237,16 @@ EOF function create_users() { if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then createuser "$POSTGRESQL_USER" - createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" + + EXTRA_ARGS="" + if [ -v POSTGRESQL_ENCODING ]; then + EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING" + fi + if [ -v POSTGRESQL_LOCALE ]; then + EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE" + fi + + createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" fi if [ -v POSTGRESQL_MASTER_USER ]; then diff --git a/16/Dockerfile.c9s b/16/Dockerfile.c9s index 7eafdcf5..0b14c628 100644 --- a/16/Dockerfile.c9s +++ b/16/Dockerfile.c9s @@ -9,6 +9,8 @@ FROM quay.io/sclorg/s2i-core-c9s:c9s # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=16 \ POSTGRESQL_PREV_VERSION=15 \ diff --git a/16/Dockerfile.fedora b/16/Dockerfile.fedora index a759f112..99d65c37 100644 --- a/16/Dockerfile.fedora +++ b/16/Dockerfile.fedora @@ -9,6 +9,8 @@ FROM quay.io/fedora/s2i-core:39 # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV NAME=postgresql \ VERSION=0 \ diff --git a/16/Dockerfile.rhel8 b/16/Dockerfile.rhel8 index 510b8f10..2bcf32d0 100644 --- a/16/Dockerfile.rhel8 +++ b/16/Dockerfile.rhel8 @@ -9,6 +9,8 @@ FROM ubi8/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=16 \ POSTGRESQL_PREV_VERSION=15 \ diff --git a/16/Dockerfile.rhel9 b/16/Dockerfile.rhel9 index a81820a1..11e1c225 100644 --- a/16/Dockerfile.rhel9 +++ b/16/Dockerfile.rhel9 @@ -9,6 +9,8 @@ FROM ubi9/s2i-core # * $POSTGRESQL_DATABASE - Name of the database to create # * $POSTGRESQL_ADMIN_PASSWORD (Optional) - Password for the 'postgres' # PostgreSQL administrative account +# * $POSTGRESQL_ENCODING - Database encoding. Default to UTF8 +# * $POSTGRESQL_LOCALE - Database locale. Default to en_US ENV POSTGRESQL_VERSION=16 \ POSTGRESQL_PREV_VERSION=15 \ diff --git a/16/root/usr/share/container-scripts/postgresql/common.sh b/16/root/usr/share/container-scripts/postgresql/common.sh index b7482bdb..ef1e03e5 100644 --- a/16/root/usr/share/container-scripts/postgresql/common.sh +++ b/16/root/usr/share/container-scripts/postgresql/common.sh @@ -201,7 +201,10 @@ initdb_wrapper () # Initialize the database cluster with utf8 support enabled by default. # This might affect performance, see: # http://www.postgresql.org/docs/16/static/locale.html - LANG=${LANG:-en_US.utf8} "$@" + ENCODING=${POSTGRESQL_ENCODING:-UTF8} + LOCALE=${POSTGRESQL_LOCALE:-en_US} + if [ ${LOCALE} == "C" ] ; then LANG=C; fi + LANG=${LANG:-$LOCALE.$ENCODING} "$@" -E $ENCODING } function initialize_database() { @@ -234,7 +237,16 @@ EOF function create_users() { if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then createuser "$POSTGRESQL_USER" - createdb --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" + + EXTRA_ARGS="" + if [ -v POSTGRESQL_ENCODING ]; then + EXTRA_ARGS="$EXTRA_ARGS -E $POSTGRESQL_ENCODING" + fi + if [ -v POSTGRESQL_LOCALE ]; then + EXTRA_ARGS="$EXTRA_ARGS -l $POSTGRESQL_LOCALE" + fi + + createdb $EXTRA_ARGS --owner="$POSTGRESQL_USER" "$POSTGRESQL_DATABASE" fi if [ -v POSTGRESQL_MASTER_USER ]; then