Skip to content

Commit 5c93520

Browse files
committed
docker-entrypoint: use natural sort for scripts to launch
Fixes nginx#489.
1 parent 734e1de commit 5c93520

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

entrypoint/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

mainline/alpine-perl/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

mainline/alpine/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

mainline/debian-perl/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

mainline/debian/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

stable/alpine-perl/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

stable/alpine/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

stable/debian-perl/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

stable/debian/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
1414
echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

1616
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
17-
find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
17+
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
1818
case "$f" in
1919
*.sh)
2020
if [ -x "$f" ]; then

0 commit comments

Comments
 (0)