Skip to content

Commit 21e4969

Browse files
committed
Docker: check out packaging tags.
This will ensure we're checking out source code that is close to what we have in binary packages. While at it, remove the checkout directory when it's no longer needed.
1 parent e3ff58f commit 21e4969

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/docker/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ include ../shasum.mak
66
DEFAULT_VERSION := $(NXT_VERSION)
77

88
VERSION ?= $(DEFAULT_VERSION)
9+
PATCHLEVEL ?= 1
910

1011
EXPORT_DIR := $(VERSION)
1112

@@ -73,6 +74,7 @@ Dockerfile.%: ../../version template.Dockerfile
7374
@echo "===> Building $@"
7475
cat template.Dockerfile | sed \
7576
-e 's,@@VERSION@@,$(VERSION),g' \
77+
-e 's,@@PATCHLEVEL@@,$(PATCHLEVEL),g' \
7678
-e 's,@@CONTAINER@@,$(CONTAINER_$(call modname, $*)),g' \
7779
-e 's,@@CONFIGURE@@,$(CONFIGURE_$(call modname, $*)),g' \
7880
-e 's,@@INSTALL@@,$(INSTALL_$(call modname, $*)),g' \

pkg/docker/template.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ RUN set -ex \
77
&& apt-get update \
88
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev \
99
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
10-
&& hg clone https://hg.nginx.org/unit \
10+
&& hg clone -u @@VERSION@@-@@PATCHLEVEL@@ https://hg.nginx.org/unit \
1111
&& cd unit \
12-
&& hg up @@VERSION@@ \
1312
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
1413
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
1514
&& CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
@@ -39,6 +38,8 @@ RUN set -ex \
3938
&& ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --modules=/usr/lib/unit/modules \
4039
&& ./configure @@CONFIGURE@@ \
4140
&& make -j $NCPU @@INSTALL@@ \
41+
&& cd \
42+
&& rm -rf unit \
4243
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
4344
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
4445
done \

0 commit comments

Comments
 (0)