You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-07-26 23:21:10 +03:00
Allow "initdb.d" scripts to be executed instead of sourced
This commit is contained in:
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
@ -142,7 +142,17 @@ if [ "$1" = 'postgres' ]; then
|
|||||||
echo
|
echo
|
||||||
for f in /docker-entrypoint-initdb.d/*; do
|
for f in /docker-entrypoint-initdb.d/*; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.sh) echo "$0: running $f"; . "$f" ;;
|
*.sh)
|
||||||
|
# https://github.com/docker-library/postgres/issues/450#issuecomment-393167936
|
||||||
|
# https://github.com/docker-library/postgres/pull/452
|
||||||
|
if [ -x "$f" ]; then
|
||||||
|
echo "$0: running $f"
|
||||||
|
"$f"
|
||||||
|
else
|
||||||
|
echo "$0: sourcing $f"
|
||||||
|
. "$f"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
*.sql) echo "$0: running $f"; "${psql[@]}" -f "$f"; echo ;;
|
||||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | "${psql[@]}"; echo ;;
|
||||||
*) echo "$0: ignoring $f" ;;
|
*) echo "$0: ignoring $f" ;;
|
||||||
|
Reference in New Issue
Block a user