add files for building containter artifacts

Lifted in large parts from version 9.5 of the SCL postgresql container.

https://github.com/sclorg/postgresql-container
This commit is contained in:
Nils Philippsen 2017-05-11 11:56:47 +02:00
commit fa7e7e5dec
15 changed files with 830 additions and 0 deletions

28
root/usr/bin/run-postgresql Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
export ENABLE_REPLICATION=${ENABLE_REPLICATION:-false}
set -eu
export_vars=$(cgroup-limits) ; export $export_vars
source "${CONTAINER_SCRIPTS_PATH}/common.sh"
set_pgdata
check_env_vars
generate_passwd_file
generate_postgresql_config
if [ ! -f "$PGDATA/postgresql.conf" ]; then
initialize_database
NEED_TO_CREATE_USERS=yes
fi
pg_ctl -w start -o "-h ''"
if [ "${NEED_TO_CREATE_USERS:-}" == "yes" ]; then
create_users
fi
set_passwords
pg_ctl stop
unset_env_vars
exec postgres "$@"