From a511763ae75cc0cbe46aa2ec271005639d187eca Mon Sep 17 00:00:00 2001 From: Nick Cox Date: Thu, 3 Mar 2016 18:13:01 -0700 Subject: [PATCH 1/2] Add POSTGRES_INITDB_ARGS env var --- 9.1/docker-entrypoint.sh | 2 +- 9.2/docker-entrypoint.sh | 2 +- 9.3/docker-entrypoint.sh | 2 +- 9.4/docker-entrypoint.sh | 2 +- 9.5/docker-entrypoint.sh | 2 +- docker-entrypoint.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index d4f689c08f..9272545b35 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb + gosu postgres initdb "$POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index d4f689c08f..9272545b35 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb + gosu postgres initdb "$POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index d4f689c08f..9272545b35 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb + gosu postgres initdb "$POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index d4f689c08f..9272545b35 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb + gosu postgres initdb "$POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index d4f689c08f..9272545b35 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb + gosu postgres initdb "$POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index d4f689c08f..9272545b35 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb + gosu postgres initdb "$POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up From 3f8e9784438c8fe54f831c301a45f4d55f6fa453 Mon Sep 17 00:00:00 2001 From: Nick Cox Date: Mon, 14 Mar 2016 18:56:22 -0600 Subject: [PATCH 2/2] tianon's eval suggestion --- 9.1/docker-entrypoint.sh | 2 +- 9.2/docker-entrypoint.sh | 2 +- 9.3/docker-entrypoint.sh | 2 +- 9.4/docker-entrypoint.sh | 2 +- 9.5/docker-entrypoint.sh | 2 +- docker-entrypoint.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 9272545b35..22ecdec9b4 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb "$POSTGRES_INITDB_ARGS" + eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 9272545b35..22ecdec9b4 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb "$POSTGRES_INITDB_ARGS" + eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 9272545b35..22ecdec9b4 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb "$POSTGRES_INITDB_ARGS" + eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 9272545b35..22ecdec9b4 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb "$POSTGRES_INITDB_ARGS" + eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/9.5/docker-entrypoint.sh b/9.5/docker-entrypoint.sh index 9272545b35..22ecdec9b4 100755 --- a/9.5/docker-entrypoint.sh +++ b/9.5/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb "$POSTGRES_INITDB_ARGS" + eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 9272545b35..22ecdec9b4 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then # look specifically for PG_VERSION, as it is expected in the DB dir if [ ! -s "$PGDATA/PG_VERSION" ]; then - gosu postgres initdb "$POSTGRES_INITDB_ARGS" + eval "gosu postgres initdb $POSTGRES_INITDB_ARGS" # check password first so we can output the warning before postgres # messes it up