init
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
#
|
||||
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
|
||||
#
|
||||
# PLEASE DO NOT EDIT IT DIRECTLY.
|
||||
#
|
||||
FROM nginx:1.28.0-alpine-slim
|
||||
|
||||
ENV NJS_VERSION 0.8.10
|
||||
ENV NJS_RELEASE 1
|
||||
|
||||
RUN set -x \
|
||||
&& apkArch="$(cat /etc/apk/arch)" \
|
||||
&& nginxPackages=" \
|
||||
nginx=${NGINX_VERSION}-r${PKG_RELEASE} \
|
||||
nginx-module-xslt=${NGINX_VERSION}-r${DYNPKG_RELEASE} \
|
||||
nginx-module-geoip=${NGINX_VERSION}-r${DYNPKG_RELEASE} \
|
||||
nginx-module-image-filter=${NGINX_VERSION}-r${DYNPKG_RELEASE} \
|
||||
nginx-module-njs=${NGINX_VERSION}.${NJS_VERSION}-r${NJS_RELEASE} \
|
||||
" \
|
||||
# install prerequisites for public key and pkg-oss checks
|
||||
&& apk add --no-cache --virtual .checksum-deps \
|
||||
openssl \
|
||||
&& case "$apkArch" in \
|
||||
x86_64|aarch64) \
|
||||
# arches officially built by upstream
|
||||
apk add -X "https://nginx.org/packages/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" --no-cache $nginxPackages \
|
||||
;; \
|
||||
*) \
|
||||
# we're on an architecture upstream doesn't officially build for
|
||||
# let's build binaries from the published packaging sources
|
||||
set -x \
|
||||
&& tempDir="$(mktemp -d)" \
|
||||
&& chown nobody:nobody $tempDir \
|
||||
&& apk add --no-cache --virtual .build-deps \
|
||||
gcc \
|
||||
libc-dev \
|
||||
make \
|
||||
openssl-dev \
|
||||
pcre2-dev \
|
||||
zlib-dev \
|
||||
linux-headers \
|
||||
libxslt-dev \
|
||||
gd-dev \
|
||||
geoip-dev \
|
||||
libedit-dev \
|
||||
bash \
|
||||
alpine-sdk \
|
||||
findutils \
|
||||
curl \
|
||||
&& su nobody -s /bin/sh -c " \
|
||||
export HOME=${tempDir} \
|
||||
&& cd ${tempDir} \
|
||||
&& curl -f -L -O https://github.com/nginx/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
|
||||
&& PKGOSSCHECKSUM=\"517bc18954ccf4efddd51986584ca1f37966833ad342a297e1fe58fd0faf14c5a4dabcb23519dca433878a2927a95d6bea05a6749ee2fa67a33bf24cdc41b1e4 *${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 \
|
||||
echo \"pkg-oss tarball checksum verification failed!\"; \
|
||||
exit 1; \
|
||||
fi \
|
||||
&& tar xzvf ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz \
|
||||
&& cd pkg-oss-${NGINX_VERSION}-${PKG_RELEASE} \
|
||||
&& cd alpine \
|
||||
&& make module-geoip module-image-filter module-njs module-xslt \
|
||||
&& apk index --allow-untrusted -o ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz ${tempDir}/packages/alpine/${apkArch}/*.apk \
|
||||
&& 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 --no-network .build-deps \
|
||||
&& apk add -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages \
|
||||
;; \
|
||||
esac \
|
||||
# remove 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 [ -f "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi \
|
||||
# Bring in curl and ca-certificates to make registering on DNS SD easier
|
||||
&& apk add --no-cache curl ca-certificates
|
||||
Reference in New Issue
Block a user