You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-11-17 13:02:40 +03:00
Merge pull request #224 from DanielDent/master
POSTGRES_XLOG_DIR to specify transaction log dir
This commit is contained in:
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec su-exec postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec su-exec postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec su-exec postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec su-exec postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec su-exec postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
@@ -37,6 +37,13 @@ if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
|
||||
chown -R postgres /var/run/postgresql
|
||||
chmod g+s /var/run/postgresql
|
||||
|
||||
# Create the transaction log directory before initdb is run (below) so the directory is owned by the correct user
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
mkdir -p "$POSTGRES_INITDB_XLOGDIR"
|
||||
chown -R postgres "$POSTGRES_INITDB_XLOGDIR"
|
||||
chmod 700 "$POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
|
||||
exec gosu postgres "$BASH_SOURCE" "$@"
|
||||
fi
|
||||
|
||||
@@ -48,6 +55,9 @@ if [ "$1" = 'postgres' ]; then
|
||||
# look specifically for PG_VERSION, as it is expected in the DB dir
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
file_env 'POSTGRES_INITDB_ARGS'
|
||||
if [ "$POSTGRES_INITDB_XLOGDIR" ]; then
|
||||
export POSTGRES_INITDB_ARGS="$POSTGRES_INITDB_ARGS --xlogdir $POSTGRES_INITDB_XLOGDIR"
|
||||
fi
|
||||
eval "initdb --username=postgres $POSTGRES_INITDB_ARGS"
|
||||
|
||||
# check password first so we can output the warning before postgres
|
||||
|
||||
Reference in New Issue
Block a user