-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Updated mainline nginx to 1.25.0 and njs to 0.7.12. #14719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
jnoordsij
reviewed
May 24, 2023
Also, extended envsubst-based templating to process stream (TCP/UDP) servers.
Diff for 841f374:diff --git a/_bashbrew-cat b/_bashbrew-cat
index c96db49..5b6001b 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,31 +1,6 @@
Maintainers: NGINX Docker Maintainers <docker-maint@nginx.com> (@nginxinc)
GitRepo: https://github.com/nginxinc/docker-nginx.git
-Tags: 1.23.4, mainline, 1, 1.23, latest, 1.23.4-bullseye, mainline-bullseye, 1-bullseye, 1.23-bullseye, bullseye
-Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 73a5acae6945b75b433cafd0c9318e4378e72cbb
-Directory: mainline/debian
-
-Tags: 1.23.4-alpine, mainline-alpine, 1-alpine, 1.23-alpine, alpine, 1.23.4-alpine3.17, mainline-alpine3.17, 1-alpine3.17, 1.23-alpine3.17, alpine3.17
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 73a5acae6945b75b433cafd0c9318e4378e72cbb
-Directory: mainline/alpine
-
-Tags: 1.23.4-alpine-perl, mainline-alpine-perl, 1-alpine-perl, 1.23-alpine-perl, alpine-perl, 1.23.4-alpine3.17-perl, mainline-alpine3.17-perl, 1-alpine3.17-perl, 1.23-alpine3.17-perl, alpine3.17-perl
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 73a5acae6945b75b433cafd0c9318e4378e72cbb
-Directory: mainline/alpine-perl
-
-Tags: 1.23.4-alpine-slim, mainline-alpine-slim, 1-alpine-slim, 1.23-alpine-slim, alpine-slim, 1.23.4-alpine3.17-slim, mainline-alpine3.17-slim, 1-alpine3.17-slim, 1.23-alpine3.17-slim, alpine3.17-slim
-Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 73a5acae6945b75b433cafd0c9318e4378e72cbb
-Directory: mainline/alpine-slim
-
-Tags: 1.23.4-perl, mainline-perl, 1-perl, 1.23-perl, perl, 1.23.4-bullseye-perl, mainline-bullseye-perl, 1-bullseye-perl, 1.23-bullseye-perl, bullseye-perl
-Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 73a5acae6945b75b433cafd0c9318e4378e72cbb
-Directory: mainline/debian-perl
-
Tags: 1.24.0, stable, 1.24, 1.24.0-bullseye, stable-bullseye, 1.24-bullseye
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
GitCommit: 1a8d87b69760693a8e33cd8a9e0c2e5f0e8b0e3c
@@ -50,3 +25,28 @@ Tags: 1.24.0-perl, stable-perl, 1.24-perl, 1.24.0-bullseye-perl, stable-bullseye
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
GitCommit: 1a8d87b69760693a8e33cd8a9e0c2e5f0e8b0e3c
Directory: stable/debian-perl
+
+Tags: 1.25.0, mainline, 1, 1.25, latest, 1.25.0-bullseye, mainline-bullseye, 1-bullseye, 1.25-bullseye, bullseye
+Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
+GitCommit: 3591b5e431af710432bd4852d9ee26eb19992776
+Directory: mainline/debian
+
+Tags: 1.25.0-alpine, mainline-alpine, 1-alpine, 1.25-alpine, alpine, 1.25.0-alpine3.17, mainline-alpine3.17, 1-alpine3.17, 1.25-alpine3.17, alpine3.17
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
+GitCommit: 123ef33694fccfefcb7db63251b21c0496537c76
+Directory: mainline/alpine
+
+Tags: 1.25.0-alpine-perl, mainline-alpine-perl, 1-alpine-perl, 1.25-alpine-perl, alpine-perl, 1.25.0-alpine3.17-perl, mainline-alpine3.17-perl, 1-alpine3.17-perl, 1.25-alpine3.17-perl, alpine3.17-perl
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
+GitCommit: 123ef33694fccfefcb7db63251b21c0496537c76
+Directory: mainline/alpine-perl
+
+Tags: 1.25.0-alpine-slim, mainline-alpine-slim, 1-alpine-slim, 1.25-alpine-slim, alpine-slim, 1.25.0-alpine3.17-slim, mainline-alpine3.17-slim, 1-alpine3.17-slim, 1.25-alpine3.17-slim, alpine3.17-slim
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
+GitCommit: 3591b5e431af710432bd4852d9ee26eb19992776
+Directory: mainline/alpine-slim
+
+Tags: 1.25.0-perl, mainline-perl, 1-perl, 1.25-perl, perl, 1.25.0-bullseye-perl, mainline-bullseye-perl, 1-bullseye-perl, 1.25-bullseye-perl, bullseye-perl
+Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
+GitCommit: ee6b833b5d9d1966b85a5d318efc04cf8b1c1ba5
+Directory: mainline/debian-perl
diff --git a/_bashbrew-list b/_bashbrew-list
index f41c19b..7dfae50 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -8,26 +8,6 @@ nginx:1-alpine-slim
nginx:1-bullseye
nginx:1-bullseye-perl
nginx:1-perl
-nginx:1.23
-nginx:1.23-alpine
-nginx:1.23-alpine3.17
-nginx:1.23-alpine3.17-perl
-nginx:1.23-alpine3.17-slim
-nginx:1.23-alpine-perl
-nginx:1.23-alpine-slim
-nginx:1.23-bullseye
-nginx:1.23-bullseye-perl
-nginx:1.23-perl
-nginx:1.23.4
-nginx:1.23.4-alpine
-nginx:1.23.4-alpine3.17
-nginx:1.23.4-alpine3.17-perl
-nginx:1.23.4-alpine3.17-slim
-nginx:1.23.4-alpine-perl
-nginx:1.23.4-alpine-slim
-nginx:1.23.4-bullseye
-nginx:1.23.4-bullseye-perl
-nginx:1.23.4-perl
nginx:1.24
nginx:1.24-alpine
nginx:1.24-alpine3.17
@@ -48,6 +28,26 @@ nginx:1.24.0-alpine-slim
nginx:1.24.0-bullseye
nginx:1.24.0-bullseye-perl
nginx:1.24.0-perl
+nginx:1.25
+nginx:1.25-alpine
+nginx:1.25-alpine3.17
+nginx:1.25-alpine3.17-perl
+nginx:1.25-alpine3.17-slim
+nginx:1.25-alpine-perl
+nginx:1.25-alpine-slim
+nginx:1.25-bullseye
+nginx:1.25-bullseye-perl
+nginx:1.25-perl
+nginx:1.25.0
+nginx:1.25.0-alpine
+nginx:1.25.0-alpine3.17
+nginx:1.25.0-alpine3.17-perl
+nginx:1.25.0-alpine3.17-slim
+nginx:1.25.0-alpine-perl
+nginx:1.25.0-alpine-slim
+nginx:1.25.0-bullseye
+nginx:1.25.0-bullseye-perl
+nginx:1.25.0-perl
nginx:alpine
nginx:alpine3.17
nginx:alpine3.17-perl
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index 1fa62b5..d318ca1 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,10 +1,10 @@
-nginx:bullseye
-nginx:alpine3.17-slim
-nginx:bullseye-perl
nginx:1.24-bullseye
nginx:1.24-alpine3.17-slim
nginx:1.24-bullseye-perl
-nginx:alpine3.17
-nginx:alpine3.17-perl
+nginx:bullseye
+nginx:alpine3.17-slim
+nginx:bullseye-perl
nginx:1.24-alpine3.17
nginx:1.24-alpine3.17-perl
+nginx:alpine3.17
+nginx:alpine3.17-perl
diff --git a/nginx_alpine3.17-perl/Dockerfile b/nginx_alpine3.17-perl/Dockerfile
index 134f445..93576b1 100644
--- a/nginx_alpine3.17-perl/Dockerfile
+++ b/nginx_alpine3.17-perl/Dockerfile
@@ -3,7 +3,7 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM nginx:1.23.4-alpine
+FROM nginx:1.25.0-alpine
RUN set -x \
&& apkArch="$(cat /etc/apk/arch)" \
@@ -55,7 +55,7 @@ RUN set -x \
export HOME=${tempDir} \
&& cd ${tempDir} \
&& curl -f -O https://hg.nginx.org/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
- && PKGOSSCHECKSUM=\"8f3f6c1ddd984c0c7320d3bea25eee42749db6d69c251223cf91d69b8d80b703ab39eb94fcf731399a7693ebd8dd37d1b3232ea1184ca98e5ca0ba6165e1a05c *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
+ && PKGOSSCHECKSUM=\"18bee4bd498e0b8da765e8cd2d824e1027d40fd95d55fd59339cdb5d5e0e633795f4196c76045e86027cdfc6ab05a3cc0d39b25bd0a967f1edd47910d813262a *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
&& if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then \
echo \"pkg-oss tarball checksum verification succeeded!\"; \
else \
diff --git a/nginx_alpine3.17-slim/20-envsubst-on-templates.sh b/nginx_alpine3.17-slim/20-envsubst-on-templates.sh
index d0398b1..f3fb9fc 100755
--- a/nginx_alpine3.17-slim/20-envsubst-on-templates.sh
+++ b/nginx_alpine3.17-slim/20-envsubst-on-templates.sh
@@ -10,10 +10,30 @@ entrypoint_log() {
fi
}
+add_stream_block() {
+ local conffile="/etc/nginx/nginx.conf"
+
+ if grep -q -E "\s*stream\s*\{" "$conffile"; then
+ entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates"
+ else
+ # check if the file can be modified, e.g. not on a r/o filesystem
+ touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: info: can not modify $conffile (read-only file system?)"; exit 0; }
+ entrypoint_log "$ME: Appending stream block to $conffile to include $stream_output_dir/*.conf"
+ cat << END >> "$conffile"
+# added by "$ME" on "$(date)"
+stream {
+ include $stream_output_dir/*.conf;
+}
+END
+ fi
+}
+
auto_envsubst() {
local template_dir="${NGINX_ENVSUBST_TEMPLATE_DIR:-/etc/nginx/templates}"
local suffix="${NGINX_ENVSUBST_TEMPLATE_SUFFIX:-.template}"
local output_dir="${NGINX_ENVSUBST_OUTPUT_DIR:-/etc/nginx/conf.d}"
+ local stream_suffix="${NGINX_ENVSUBST_STREAM_TEMPLATE_SUFFIX:-.stream-template}"
+ local stream_output_dir="${NGINX_ENVSUBST_STREAM_OUTPUT_DIR:-/etc/nginx/stream-conf.d}"
local filter="${NGINX_ENVSUBST_FILTER:-}"
local template defined_envs relative_path output_path subdir
@@ -32,6 +52,25 @@ auto_envsubst() {
entrypoint_log "$ME: Running envsubst on $template to $output_path"
envsubst "$defined_envs" < "$template" > "$output_path"
done
+
+ # Print the first file with the stream suffix, this will be false if there are none
+ if test -n "$(find "$template_dir" -name "*$stream_suffix" -print -quit)"; then
+ mkdir -p "$stream_output_dir"
+ if [ ! -w "$stream_output_dir" ]; then
+ entrypoint_log "$ME: ERROR: $template_dir exists, but $stream_output_dir is not writable"
+ return 0
+ fi
+ add_stream_block
+ find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do
+ relative_path="${template#$template_dir/}"
+ output_path="$stream_output_dir/${relative_path%$stream_suffix}"
+ subdir=$(dirname "$relative_path")
+ # create a subdirectory where the template file exists
+ mkdir -p "$stream_output_dir/$subdir"
+ entrypoint_log "$ME: Running envsubst on $template to $output_path"
+ envsubst "$defined_envs" < "$template" > "$output_path"
+ done
+ fi
}
auto_envsubst
diff --git a/nginx_alpine3.17-slim/Dockerfile b/nginx_alpine3.17-slim/Dockerfile
index f35e861..8edcb09 100644
--- a/nginx_alpine3.17-slim/Dockerfile
+++ b/nginx_alpine3.17-slim/Dockerfile
@@ -7,7 +7,7 @@ FROM alpine:3.17
LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
-ENV NGINX_VERSION 1.23.4
+ENV NGINX_VERSION 1.25.0
ENV PKG_RELEASE 1
RUN set -x \
@@ -57,7 +57,7 @@ RUN set -x \
export HOME=${tempDir} \
&& cd ${tempDir} \
&& curl -f -O https://hg.nginx.org/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
- && PKGOSSCHECKSUM=\"8f3f6c1ddd984c0c7320d3bea25eee42749db6d69c251223cf91d69b8d80b703ab39eb94fcf731399a7693ebd8dd37d1b3232ea1184ca98e5ca0ba6165e1a05c *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
+ && PKGOSSCHECKSUM=\"18bee4bd498e0b8da765e8cd2d824e1027d40fd95d55fd59339cdb5d5e0e633795f4196c76045e86027cdfc6ab05a3cc0d39b25bd0a967f1edd47910d813262a *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
&& if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then \
echo \"pkg-oss tarball checksum verification succeeded!\"; \
else \
diff --git a/nginx_alpine3.17/Dockerfile b/nginx_alpine3.17/Dockerfile
index bb064be..901442b 100644
--- a/nginx_alpine3.17/Dockerfile
+++ b/nginx_alpine3.17/Dockerfile
@@ -3,9 +3,9 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM nginx:1.23.4-alpine-slim
+FROM nginx:1.25.0-alpine-slim
-ENV NJS_VERSION 0.7.11
+ENV NJS_VERSION 0.7.12
RUN set -x \
&& apkArch="$(cat /etc/apk/arch)" \
@@ -59,7 +59,7 @@ RUN set -x \
export HOME=${tempDir} \
&& cd ${tempDir} \
&& curl -f -O https://hg.nginx.org/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
- && PKGOSSCHECKSUM=\"8f3f6c1ddd984c0c7320d3bea25eee42749db6d69c251223cf91d69b8d80b703ab39eb94fcf731399a7693ebd8dd37d1b3232ea1184ca98e5ca0ba6165e1a05c *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
+ && PKGOSSCHECKSUM=\"18bee4bd498e0b8da765e8cd2d824e1027d40fd95d55fd59339cdb5d5e0e633795f4196c76045e86027cdfc6ab05a3cc0d39b25bd0a967f1edd47910d813262a *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \
&& if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then \
echo \"pkg-oss tarball checksum verification succeeded!\"; \
else \
diff --git a/nginx_bullseye-perl/Dockerfile b/nginx_bullseye-perl/Dockerfile
index 44ac453..fe8ab0e 100644
--- a/nginx_bullseye-perl/Dockerfile
+++ b/nginx_bullseye-perl/Dockerfile
@@ -3,7 +3,7 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM nginx:1.23.4
+FROM nginx:1.25.0
RUN set -x \
&& apt-get update \
diff --git a/nginx_bullseye/20-envsubst-on-templates.sh b/nginx_bullseye/20-envsubst-on-templates.sh
index d0398b1..f3fb9fc 100755
--- a/nginx_bullseye/20-envsubst-on-templates.sh
+++ b/nginx_bullseye/20-envsubst-on-templates.sh
@@ -10,10 +10,30 @@ entrypoint_log() {
fi
}
+add_stream_block() {
+ local conffile="/etc/nginx/nginx.conf"
+
+ if grep -q -E "\s*stream\s*\{" "$conffile"; then
+ entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates"
+ else
+ # check if the file can be modified, e.g. not on a r/o filesystem
+ touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: info: can not modify $conffile (read-only file system?)"; exit 0; }
+ entrypoint_log "$ME: Appending stream block to $conffile to include $stream_output_dir/*.conf"
+ cat << END >> "$conffile"
+# added by "$ME" on "$(date)"
+stream {
+ include $stream_output_dir/*.conf;
+}
+END
+ fi
+}
+
auto_envsubst() {
local template_dir="${NGINX_ENVSUBST_TEMPLATE_DIR:-/etc/nginx/templates}"
local suffix="${NGINX_ENVSUBST_TEMPLATE_SUFFIX:-.template}"
local output_dir="${NGINX_ENVSUBST_OUTPUT_DIR:-/etc/nginx/conf.d}"
+ local stream_suffix="${NGINX_ENVSUBST_STREAM_TEMPLATE_SUFFIX:-.stream-template}"
+ local stream_output_dir="${NGINX_ENVSUBST_STREAM_OUTPUT_DIR:-/etc/nginx/stream-conf.d}"
local filter="${NGINX_ENVSUBST_FILTER:-}"
local template defined_envs relative_path output_path subdir
@@ -32,6 +52,25 @@ auto_envsubst() {
entrypoint_log "$ME: Running envsubst on $template to $output_path"
envsubst "$defined_envs" < "$template" > "$output_path"
done
+
+ # Print the first file with the stream suffix, this will be false if there are none
+ if test -n "$(find "$template_dir" -name "*$stream_suffix" -print -quit)"; then
+ mkdir -p "$stream_output_dir"
+ if [ ! -w "$stream_output_dir" ]; then
+ entrypoint_log "$ME: ERROR: $template_dir exists, but $stream_output_dir is not writable"
+ return 0
+ fi
+ add_stream_block
+ find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do
+ relative_path="${template#$template_dir/}"
+ output_path="$stream_output_dir/${relative_path%$stream_suffix}"
+ subdir=$(dirname "$relative_path")
+ # create a subdirectory where the template file exists
+ mkdir -p "$stream_output_dir/$subdir"
+ entrypoint_log "$ME: Running envsubst on $template to $output_path"
+ envsubst "$defined_envs" < "$template" > "$output_path"
+ done
+ fi
}
auto_envsubst
diff --git a/nginx_bullseye/Dockerfile b/nginx_bullseye/Dockerfile
index 31b1387..c3ccd5d 100644
--- a/nginx_bullseye/Dockerfile
+++ b/nginx_bullseye/Dockerfile
@@ -7,8 +7,8 @@ FROM debian:bullseye-slim
LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
-ENV NGINX_VERSION 1.23.4
-ENV NJS_VERSION 0.7.11
+ENV NGINX_VERSION 1.25.0
+ENV NJS_VERSION 0.7.12
ENV PKG_RELEASE 1~bullseye
RUN set -x \ Relevant Maintainers:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also, extended envsubst-based templating to process stream (TCP/UDP) servers.