From 303742415647875cd002c2ee21e8087a2db698d7 Mon Sep 17 00:00:00 2001 From: Yuichiro SHIBAYAMA Date: Sat, 21 Jan 2023 10:41:27 +0900 Subject: [PATCH] Change the loop that executes .envsh from pipeline(while + read) to for. Because pipeline is executed in a subshell, exported environment variables are not reflected in the parent shell. --- entrypoint/docker-entrypoint.sh | 2 +- mainline/alpine-slim/docker-entrypoint.sh | 2 +- mainline/debian/docker-entrypoint.sh | 2 +- stable/alpine-slim/docker-entrypoint.sh | 2 +- stable/debian/docker-entrypoint.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/entrypoint/docker-entrypoint.sh b/entrypoint/docker-entrypoint.sh index e201fe60..d3f95995 100755 --- a/entrypoint/docker-entrypoint.sh +++ b/entrypoint/docker-entrypoint.sh @@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" - find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do + for f in `find "/docker-entrypoint.d/" -follow -type f -print | sort -V`; do case "$f" in *.envsh) if [ -x "$f" ]; then diff --git a/mainline/alpine-slim/docker-entrypoint.sh b/mainline/alpine-slim/docker-entrypoint.sh index e201fe60..d3f95995 100755 --- a/mainline/alpine-slim/docker-entrypoint.sh +++ b/mainline/alpine-slim/docker-entrypoint.sh @@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" - find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do + for f in `find "/docker-entrypoint.d/" -follow -type f -print | sort -V`; do case "$f" in *.envsh) if [ -x "$f" ]; then diff --git a/mainline/debian/docker-entrypoint.sh b/mainline/debian/docker-entrypoint.sh index e201fe60..d3f95995 100755 --- a/mainline/debian/docker-entrypoint.sh +++ b/mainline/debian/docker-entrypoint.sh @@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" - find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do + for f in `find "/docker-entrypoint.d/" -follow -type f -print | sort -V`; do case "$f" in *.envsh) if [ -x "$f" ]; then diff --git a/stable/alpine-slim/docker-entrypoint.sh b/stable/alpine-slim/docker-entrypoint.sh index e201fe60..d3f95995 100755 --- a/stable/alpine-slim/docker-entrypoint.sh +++ b/stable/alpine-slim/docker-entrypoint.sh @@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" - find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do + for f in `find "/docker-entrypoint.d/" -follow -type f -print | sort -V`; do case "$f" in *.envsh) if [ -x "$f" ]; then diff --git a/stable/debian/docker-entrypoint.sh b/stable/debian/docker-entrypoint.sh index e201fe60..d3f95995 100755 --- a/stable/debian/docker-entrypoint.sh +++ b/stable/debian/docker-entrypoint.sh @@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration" entrypoint_log "$0: Looking for shell scripts in /docker-entrypoint.d/" - find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do + for f in `find "/docker-entrypoint.d/" -follow -type f -print | sort -V`; do case "$f" in *.envsh) if [ -x "$f" ]; then