-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update mainline NGINX Debian release to bookworm * Add option to use a "local" resolver * Use no-network option for `apk del`
- Loading branch information
Showing
19 changed files
with
106 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# vim:sw=2:ts=2:sts=2:et | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 | ||
|
||
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) |
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# vim:sw=2:ts=2:sts=2:et | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 | ||
|
||
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ FROM $IMAGE | |
|
||
LABEL maintainer="NGINX Docker Maintainers <[email protected]>" | ||
|
||
ENV NGINX_VERSION 1.25.0 | ||
ENV NGINX_VERSION 1.25.1 | ||
ENV PKG_RELEASE 1 | ||
|
||
ARG UID=101 | ||
|
@@ -61,7 +61,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=\"18bee4bd498e0b8da765e8cd2d824e1027d40fd95d55fd59339cdb5d5e0e633795f4196c76045e86027cdfc6ab05a3cc0d39b25bd0a967f1edd47910d813262a *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\" \ | ||
&& PKGOSSCHECKSUM=\"dd08a5c2b441817d58ffc91ade0d927a21bc9854c768391e92a005997a2961bcda64ca6a5cfce98d5394ac2787c8f4839b150f206835a8a7db944625651f9fd8 *${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 \ | ||
|
@@ -76,12 +76,12 @@ RUN set -x \ | |
&& abuild-sign -k ${tempDir}/.abuild/abuild-key.rsa ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz \ | ||
" \ | ||
&& cp ${tempDir}/.abuild/abuild-key.rsa.pub /etc/apk/keys/ \ | ||
&& apk del .build-deps \ | ||
&& apk del --no-network .build-deps \ | ||
&& apk add -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages \ | ||
;; \ | ||
esac \ | ||
# remove checksum deps | ||
&& apk del .checksum-deps \ | ||
&& apk del --no-network .checksum-deps \ | ||
# if we have leftovers from building, let's purge them (including extra, unnecessary build deps) | ||
&& if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi \ | ||
&& if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \ | ||
|
@@ -101,7 +101,7 @@ RUN set -x \ | |
| sort -u \ | ||
)" \ | ||
&& apk add --no-cache $runDeps \ | ||
&& apk del .gettext \ | ||
&& apk del --no-network .gettext \ | ||
&& mv /tmp/envsubst /usr/local/bin/ \ | ||
# Bring in tzdata so users could set the timezones through the environment | ||
# variables | ||
|
@@ -125,6 +125,7 @@ RUN sed -i 's,listen 80;,listen 8080;,' /etc/nginx/conf.d/default.co | |
|
||
COPY docker-entrypoint.sh / | ||
COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d | ||
COPY 15-local-resolvers.envsh /docker-entrypoint.d | ||
COPY 20-envsubst-on-templates.sh /docker-entrypoint.d | ||
COPY 30-tune-worker-processes.sh /docker-entrypoint.d | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# vim:sw=2:ts=2:sts=2:et | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 | ||
|
||
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,22 @@ | |
# | ||
# PLEASE DO NOT EDIT IT DIRECTLY. | ||
# | ||
ARG IMAGE=debian:bullseye-slim | ||
ARG IMAGE=debian:bookworm-slim | ||
FROM $IMAGE | ||
|
||
LABEL maintainer="NGINX Docker Maintainers <[email protected]>" | ||
|
||
ENV NGINX_VERSION 1.25.0 | ||
ENV NGINX_VERSION 1.25.1 | ||
ENV NJS_VERSION 0.7.12 | ||
ENV PKG_RELEASE 1~bullseye | ||
ENV PKG_RELEASE 1~bookworm | ||
|
||
ARG UID=101 | ||
ARG GID=101 | ||
|
||
RUN set -x \ | ||
# create nginx user/group first, to be consistent throughout docker variants | ||
&& addgroup --system --gid $GID nginx || true \ | ||
&& adduser --system --disabled-login --ingroup nginx --no-create-home --home /nonexistent --gecos "nginx user" --shell /bin/false --uid $UID nginx || true \ | ||
&& groupadd --system --gid $GID nginx || true \ | ||
&& useradd --system --gid nginx --no-create-home --home /nonexistent --comment "nginx user" --shell /bin/false --uid $UID nginx || true \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends --no-install-suggests -y gnupg1 ca-certificates \ | ||
&& \ | ||
|
@@ -48,13 +48,13 @@ RUN set -x \ | |
&& case "$dpkgArch" in \ | ||
amd64|arm64) \ | ||
# arches officialy built by upstream | ||
echo "deb [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bullseye nginx" >> /etc/apt/sources.list.d/nginx.list \ | ||
echo "deb [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list.d/nginx.list \ | ||
&& apt-get update \ | ||
;; \ | ||
*) \ | ||
# we're on an architecture upstream doesn't officially build for | ||
# let's build binaries from the published source packages | ||
echo "deb-src [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bullseye nginx" >> /etc/apt/sources.list.d/nginx.list \ | ||
echo "deb-src [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list.d/nginx.list \ | ||
\ | ||
# new directory for storing sources and .deb files | ||
&& tempDir="$(mktemp -d)" \ | ||
|
@@ -122,6 +122,7 @@ RUN sed -i 's,listen 80;,listen 8080;,' /etc/nginx/conf.d/default.co | |
|
||
COPY docker-entrypoint.sh / | ||
COPY 10-listen-on-ipv6-by-default.sh /docker-entrypoint.d | ||
COPY 15-local-resolvers.envsh /docker-entrypoint.d | ||
COPY 20-envsubst-on-templates.sh /docker-entrypoint.d | ||
COPY 30-tune-worker-processes.sh /docker-entrypoint.d | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# vim:sw=2:ts=2:sts=2:et | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 | ||
|
||
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) |
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# vim:sw=2:ts=2:sts=2:et | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 | ||
|
||
export NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) |
Oops, something went wrong.