Skip to content

Commit e99bd9a

Browse files
committed
Reset "pipefail" for initdb.d scripts"
1 parent 3f8d33c commit e99bd9a

13 files changed

+91
-0
lines changed

10/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

10/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

11/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

11/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.3/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.3/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.4/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.4/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.5/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.5/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.6/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

9.6/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ if [ "$1" = 'postgres' ]; then
139139

140140
psql+=( --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" )
141141

142+
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
143+
set +o pipefail
144+
# TODO find a better solution to allowing initdb.d scripts to opt out of pipefail; perhaps checking for +x and a shebang or something?
145+
142146
echo
143147
for f in /docker-entrypoint-initdb.d/*; do
144148
case "$f" in
@@ -150,6 +154,9 @@ if [ "$1" = 'postgres' ]; then
150154
echo
151155
done
152156

157+
# see note above re: issue #450
158+
set -o pipefail
159+
153160
PGUSER="${PGUSER:-postgres}" \
154161
pg_ctl -D "$PGDATA" -m fast -w stop
155162

0 commit comments

Comments
 (0)