@@ -57,24 +57,46 @@ RUN set -x \
5757 ;; \
5858 *) \
5959# we're on an architecture upstream doesn't officially build for
60- # let's build binaries from the published source packages
61- echo "deb-src [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list.d/nginx.list \
62- \
60+ # let's build binaries from the published packaging sources
6361# new directory for storing sources and .deb files
64- && tempDir="$(mktemp -d)" \
62+ tempDir="$(mktemp -d)" \
6563 && chmod 777 "$tempDir" \
6664# (777 to ensure APT's "_apt" user can access it too)
6765 \
6866# save list of currently-installed packages so build dependencies can be cleanly removed later
6967 && savedAptMark="$(apt-mark showmanual)" \
7068 \
71- # build .deb files from upstream's source packages (which are verified by apt-get)
69+ # build .deb files from upstream's packaging sources
7270 && apt-get update \
73- && apt-get build-dep -y $nginxPackages \
71+ && apt-get install --no-install-recommends --no-install-suggests -y \
72+ curl \
73+ devscripts \
74+ equivs \
75+ git \
76+ libxml2-utils \
77+ lsb-release \
78+ xsltproc \
7479 && ( \
7580 cd "$tempDir" \
76- && DEB_BUILD_OPTIONS="nocheck parallel=$(nproc)" \
77- apt-get source --compile $nginxPackages \
81+ && REVISION="${NGINX_VERSION}-${PKG_RELEASE}" \
82+ && REVISION=${REVISION%~*} \
83+ && curl -f -O https://hg.nginx.org/pkg-oss/archive/${REVISION}.tar.gz \
84+ && PKGOSSCHECKSUM="b9fbdf1779186fc02aa59dd87597fe4e906892391614289a4e6eedba398a3e770347b5b07110cca8c11fa3ba85bb711626ae69832e74c69ca8340d040a465907 *${REVISION}.tar.gz" \
85+ && if [ "$(openssl sha512 -r ${REVISION}.tar.gz)" = "$PKGOSSCHECKSUM" ]; then \
86+ echo "pkg-oss tarball checksum verification succeeded!" ; \
87+ else \
88+ echo "pkg-oss tarball checksum verification failed!" ; \
89+ exit 1; \
90+ fi \
91+ && tar xzvf ${REVISION}.tar.gz \
92+ && cd pkg-oss-${REVISION} \
93+ && cd debian \
94+ && for target in base module-geoip module-image-filter module-njs module-xslt; do \
95+ make rules-$target; \
96+ mk-build-deps --install --tool="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes" \
97+ debuild-$target/nginx-$NGINX_VERSION/debian/control; \
98+ done \
99+ && make base module-geoip module-image-filter module-njs module-xslt \
78100 ) \
79101# we don't remove APT lists here because they get re-downloaded and removed later
80102 \
0 commit comments