Skip to content

Commit 2879b26

Browse files
alessfgthresheek
authored andcommitted
fix: address Alpine bug and shell linter warnings
* Replace `-n` with `-f` in Alpine Linux conditional check * Ensure shell variables are properly quoted * Set variable before exporting to ensure it properly fails (if it fails) * Replace obsolete `-o` conditional check with `||`
1 parent a4d9a5c commit 2879b26

34 files changed

+77
-72
lines changed

Dockerfile-alpine-perl.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ RUN set -x \
6666
# remove checksum deps
6767
&& apk del --no-network .checksum-deps \
6868
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
69-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
70-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
71-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi
69+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
70+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
71+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi

Dockerfile-alpine-slim.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ RUN set -x \
7373
# remove checksum deps
7474
&& apk del --no-network .checksum-deps \
7575
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
76-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
77-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
78-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
76+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
77+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
78+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
7979
# Bring in gettext so we can get `envsubst`, then throw
8080
# the rest away. To do this, we need to install `gettext`
8181
# then move `envsubst` out of the way so `gettext` can

Dockerfile-alpine.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ RUN set -x \
7171
# remove checksum deps
7272
&& apk del --no-network .checksum-deps \
7373
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
74-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
75-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
76-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
74+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
75+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
76+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
7777
# Bring in curl and ca-certificates to make registering on DNS SD easier
7878
&& apk add --no-cache curl ca-certificates

entrypoint/10-listen-on-ipv6-by-default.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
ME=$(basename $0)
12+
ME=$(basename "$0")
1313
DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
1414

1515
# check if we have ipv6 available

entrypoint/15-local-resolvers.envsh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
88

99
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0
1010

11-
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
11+
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
12+
export NGINX_LOCAL_RESOLVERS

entrypoint/20-envsubst-on-templates.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
ME=$(basename $0)
5+
ME=$(basename "$0")
66

77
entrypoint_log() {
88
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
@@ -44,8 +44,8 @@ auto_envsubst() {
4444
return 0
4545
fi
4646
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
47-
relative_path="${template#$template_dir/}"
48-
output_path="$output_dir/${relative_path%$suffix}"
47+
relative_path="${template#"$template_dir/"}"
48+
output_path="$output_dir/${relative_path%"$suffix"}"
4949
subdir=$(dirname "$relative_path")
5050
# create a subdirectory where the template file exists
5151
mkdir -p "$output_dir/$subdir"
@@ -62,8 +62,8 @@ auto_envsubst() {
6262
fi
6363
add_stream_block
6464
find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do
65-
relative_path="${template#$template_dir/}"
66-
output_path="$stream_output_dir/${relative_path%$stream_suffix}"
65+
relative_path="${template#"$template_dir/"}"
66+
output_path="$stream_output_dir/${relative_path%"$stream_suffix"}"
6767
subdir=$(dirname "$relative_path")
6868
# create a subdirectory where the template file exists
6969
mkdir -p "$stream_output_dir/$subdir"

entrypoint/30-tune-worker-processes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -eu
55

66
LC_ALL=C
7-
ME=$( basename "$0" )
7+
ME=$(basename "$0")
88
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
99

1010
[ "${NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE:-}" ] || exit 0

entrypoint/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
12+
if [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then
1313
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
1414
entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

mainline/alpine-perl/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ RUN set -x \
7777
# remove checksum deps
7878
&& apk del --no-network .checksum-deps \
7979
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
80-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
81-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
82-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi
80+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
81+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
82+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi

mainline/alpine-slim/10-listen-on-ipv6-by-default.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
ME=$(basename $0)
12+
ME=$(basename "$0")
1313
DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
1414

1515
# check if we have ipv6 available

mainline/alpine-slim/15-local-resolvers.envsh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
88

99
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0
1010

11-
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
11+
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
12+
export NGINX_LOCAL_RESOLVERS

mainline/alpine-slim/20-envsubst-on-templates.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
ME=$(basename $0)
5+
ME=$(basename "$0")
66

77
entrypoint_log() {
88
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
@@ -44,8 +44,8 @@ auto_envsubst() {
4444
return 0
4545
fi
4646
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
47-
relative_path="${template#$template_dir/}"
48-
output_path="$output_dir/${relative_path%$suffix}"
47+
relative_path="${template#"$template_dir/"}"
48+
output_path="$output_dir/${relative_path%"$suffix"}"
4949
subdir=$(dirname "$relative_path")
5050
# create a subdirectory where the template file exists
5151
mkdir -p "$output_dir/$subdir"
@@ -62,8 +62,8 @@ auto_envsubst() {
6262
fi
6363
add_stream_block
6464
find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do
65-
relative_path="${template#$template_dir/}"
66-
output_path="$stream_output_dir/${relative_path%$stream_suffix}"
65+
relative_path="${template#"$template_dir/"}"
66+
output_path="$stream_output_dir/${relative_path%"$stream_suffix"}"
6767
subdir=$(dirname "$relative_path")
6868
# create a subdirectory where the template file exists
6969
mkdir -p "$stream_output_dir/$subdir"

mainline/alpine-slim/30-tune-worker-processes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -eu
55

66
LC_ALL=C
7-
ME=$( basename "$0" )
7+
ME=$(basename "$0")
88
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
99

1010
[ "${NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE:-}" ] || exit 0

mainline/alpine-slim/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ RUN set -x \
7979
# remove checksum deps
8080
&& apk del --no-network .checksum-deps \
8181
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
82-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
83-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
84-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
82+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
83+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
84+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
8585
# Bring in gettext so we can get `envsubst`, then throw
8686
# the rest away. To do this, we need to install `gettext`
8787
# then move `envsubst` out of the way so `gettext` can

mainline/alpine-slim/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
12+
if [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then
1313
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
1414
entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

mainline/alpine/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ RUN set -x \
8181
# remove checksum deps
8282
&& apk del --no-network .checksum-deps \
8383
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
84-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
85-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
86-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
84+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
85+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
86+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
8787
# Bring in curl and ca-certificates to make registering on DNS SD easier
8888
&& apk add --no-cache curl ca-certificates

mainline/debian/10-listen-on-ipv6-by-default.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
ME=$(basename $0)
12+
ME=$(basename "$0")
1313
DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
1414

1515
# check if we have ipv6 available

mainline/debian/15-local-resolvers.envsh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
88

99
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0
1010

11-
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
11+
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
12+
export NGINX_LOCAL_RESOLVERS

mainline/debian/20-envsubst-on-templates.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
ME=$(basename $0)
5+
ME=$(basename "$0")
66

77
entrypoint_log() {
88
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
@@ -44,8 +44,8 @@ auto_envsubst() {
4444
return 0
4545
fi
4646
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
47-
relative_path="${template#$template_dir/}"
48-
output_path="$output_dir/${relative_path%$suffix}"
47+
relative_path="${template#"$template_dir/"}"
48+
output_path="$output_dir/${relative_path%"$suffix"}"
4949
subdir=$(dirname "$relative_path")
5050
# create a subdirectory where the template file exists
5151
mkdir -p "$output_dir/$subdir"
@@ -62,8 +62,8 @@ auto_envsubst() {
6262
fi
6363
add_stream_block
6464
find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do
65-
relative_path="${template#$template_dir/}"
66-
output_path="$stream_output_dir/${relative_path%$stream_suffix}"
65+
relative_path="${template#"$template_dir/"}"
66+
output_path="$stream_output_dir/${relative_path%"$stream_suffix"}"
6767
subdir=$(dirname "$relative_path")
6868
# create a subdirectory where the template file exists
6969
mkdir -p "$stream_output_dir/$subdir"

mainline/debian/30-tune-worker-processes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -eu
55

66
LC_ALL=C
7-
ME=$( basename "$0" )
7+
ME=$(basename "$0")
88
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
99

1010
[ "${NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE:-}" ] || exit 0

mainline/debian/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
12+
if [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then
1313
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
1414
entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

stable/alpine-perl/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ RUN set -x \
7777
# remove checksum deps
7878
&& apk del --no-network .checksum-deps \
7979
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
80-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
81-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
82-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi
80+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
81+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
82+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi

stable/alpine-slim/10-listen-on-ipv6-by-default.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
ME=$(basename $0)
12+
ME=$(basename "$0")
1313
DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
1414

1515
# check if we have ipv6 available

stable/alpine-slim/15-local-resolvers.envsh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
88

99
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0
1010

11-
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
11+
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
12+
export NGINX_LOCAL_RESOLVERS

stable/alpine-slim/20-envsubst-on-templates.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
ME=$(basename $0)
5+
ME=$(basename "$0")
66

77
entrypoint_log() {
88
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
@@ -44,8 +44,8 @@ auto_envsubst() {
4444
return 0
4545
fi
4646
find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
47-
relative_path="${template#$template_dir/}"
48-
output_path="$output_dir/${relative_path%$suffix}"
47+
relative_path="${template#"$template_dir/"}"
48+
output_path="$output_dir/${relative_path%"$suffix"}"
4949
subdir=$(dirname "$relative_path")
5050
# create a subdirectory where the template file exists
5151
mkdir -p "$output_dir/$subdir"
@@ -62,8 +62,8 @@ auto_envsubst() {
6262
fi
6363
add_stream_block
6464
find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do
65-
relative_path="${template#$template_dir/}"
66-
output_path="$stream_output_dir/${relative_path%$stream_suffix}"
65+
relative_path="${template#"$template_dir/"}"
66+
output_path="$stream_output_dir/${relative_path%"$stream_suffix"}"
6767
subdir=$(dirname "$relative_path")
6868
# create a subdirectory where the template file exists
6969
mkdir -p "$stream_output_dir/$subdir"

stable/alpine-slim/30-tune-worker-processes.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -eu
55

66
LC_ALL=C
7-
ME=$( basename "$0" )
7+
ME=$(basename "$0")
88
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
99

1010
[ "${NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE:-}" ] || exit 0

stable/alpine-slim/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ RUN set -x \
7979
# remove checksum deps
8080
&& apk del --no-network .checksum-deps \
8181
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
82-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
83-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
84-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
82+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
83+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
84+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
8585
# Bring in gettext so we can get `envsubst`, then throw
8686
# the rest away. To do this, we need to install `gettext`
8787
# then move `envsubst` out of the way so `gettext` can

stable/alpine-slim/docker-entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
12+
if [ "$1" = "nginx" ] || [ "$1" = "nginx-debug" ]; then
1313
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
1414
entrypoint_log "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
1515

stable/alpine/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ RUN set -x \
8181
# remove checksum deps
8282
&& apk del --no-network .checksum-deps \
8383
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps)
84-
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \
85-
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
86-
&& if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
84+
&& if [ -f "$tempDir" ]; then rm -rf "$tempDir"; fi \
85+
&& if [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
86+
&& if [ -f "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi \
8787
# Bring in curl and ca-certificates to make registering on DNS SD easier
8888
&& apk add --no-cache curl ca-certificates

stable/debian/10-listen-on-ipv6-by-default.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ entrypoint_log() {
99
fi
1010
}
1111

12-
ME=$(basename $0)
12+
ME=$(basename "$0")
1313
DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
1414

1515
# check if we have ipv6 available

stable/debian/15-local-resolvers.envsh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
88

99
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0
1010

11-
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
11+
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
12+
export NGINX_LOCAL_RESOLVERS

0 commit comments

Comments
 (0)