summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-08-31 09:41:46 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-08-31 09:41:46 -0700
commitc45c8919c7232eb20023484f6d1fc9f1f50395d8 (patch)
treecc12eb307c1611494948645e4b487fa06495c3d2 /pkg
parent88c90e1c351ab8c5bd487a5cd4b735014b08e271 (diff)
parent9b22b6957bc87b3df002d0bc691fdae6a20abdac (diff)
downloadunit-1.31.0-1.tar.gz
unit-1.31.0-1.tar.bz2
Merged with the default branch.1.31.0-1
Diffstat (limited to 'pkg')
-rw-r--r--pkg/contrib/src/libunit-wasm/Makefile23
-rw-r--r--pkg/contrib/src/libunit-wasm/version2
-rw-r--r--pkg/contrib/src/njs/SHA512SUMS2
-rw-r--r--pkg/contrib/src/njs/version2
-rw-r--r--pkg/contrib/src/wasi-sysroot/Makefile17
-rw-r--r--pkg/contrib/src/wasi-sysroot/SHA512SUMS1
-rw-r--r--pkg/contrib/src/wasi-sysroot/version2
-rw-r--r--pkg/contrib/src/wasmtime/Makefile30
-rw-r--r--pkg/contrib/src/wasmtime/SHA512SUMS1
-rw-r--r--pkg/contrib/src/wasmtime/version1
-rw-r--r--pkg/deb/Makefile26
-rw-r--r--pkg/deb/Makefile.wasm47
-rw-r--r--pkg/deb/debian.module/copyright.unit-jsc1111
-rw-r--r--pkg/deb/debian.module/copyright.unit-jsc811
-rwxr-xr-xpkg/deb/debian.module/rules.in1
-rw-r--r--pkg/deb/debian/control.in4
-rw-r--r--pkg/deb/debian/copyright11
-rw-r--r--pkg/deb/debian/dirs1
-rw-r--r--pkg/deb/debian/rules.in10
-rw-r--r--pkg/docker/Dockerfile.go1.2017
-rw-r--r--pkg/docker/Dockerfile.go1.2189
-rw-r--r--pkg/docker/Dockerfile.jsc1119
-rw-r--r--pkg/docker/Dockerfile.minimal17
-rw-r--r--pkg/docker/Dockerfile.node1823
-rw-r--r--pkg/docker/Dockerfile.node2089
-rw-r--r--pkg/docker/Dockerfile.perl5.3617
-rw-r--r--pkg/docker/Dockerfile.perl5.3889
-rw-r--r--pkg/docker/Dockerfile.php8.217
-rw-r--r--pkg/docker/Dockerfile.python3.1117
-rw-r--r--pkg/docker/Dockerfile.ruby3.219
-rw-r--r--pkg/docker/Dockerfile.wasm109
-rw-r--r--pkg/docker/Makefile66
-rw-r--r--pkg/docker/template.Dockerfile13
-rw-r--r--pkg/rpm/Makefile10
-rw-r--r--pkg/rpm/Makefile.wasm51
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc1111
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc811
-rw-r--r--pkg/rpm/unit.module.spec.in1
-rw-r--r--pkg/rpm/unit.spec.in18
39 files changed, 812 insertions, 94 deletions
diff --git a/pkg/contrib/src/libunit-wasm/Makefile b/pkg/contrib/src/libunit-wasm/Makefile
new file mode 100644
index 00000000..51c24456
--- /dev/null
+++ b/pkg/contrib/src/libunit-wasm/Makefile
@@ -0,0 +1,23 @@
+# libunit-wasm
+
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
+LIBUNIT_WASM_URL := https://github.com/nginx/unit-wasm.git
+
+PKGS += libunit-wasm
+
+DEPS_libunit-wasm = wasi-sysroot $(DEPS_wasi-sysroot)
+
+$(TARBALLS)/libunit-wasm-$(LIBUNIT_WASM_GITHASH).tar.xz:
+ $(call download_git,$(LIBUNIT_WASM_URL),,$(LIBUNIT_WASM_GITHASH))
+
+.sum-libunit-wasm: libunit-wasm-$(LIBUNIT_WASM_GITHASH).tar.xz
+ $(call check_githash,$(LIBUNIT_WASM_GITHASH))
+ touch $@
+
+libunit-wasm: libunit-wasm-$(LIBUNIT_WASM_GITHASH).tar.xz
+ $(UNPACK)
+ $(MOVE)
+
+.libunit-wasm: libunit-wasm
+ cd $< && CFLAGS= make WASI_SYSROOT=$(TOPSRC)wasi-sysroot V=1 libunit-wasm
+ touch $@
diff --git a/pkg/contrib/src/libunit-wasm/version b/pkg/contrib/src/libunit-wasm/version
new file mode 100644
index 00000000..7ca15f98
--- /dev/null
+++ b/pkg/contrib/src/libunit-wasm/version
@@ -0,0 +1,2 @@
+LIBUNIT_WASM_VERSION := 0.1.0
+LIBUNIT_WASM_GITHASH := d6ed6a219b31a58526721f96195c80061d41ce54
diff --git a/pkg/contrib/src/njs/SHA512SUMS b/pkg/contrib/src/njs/SHA512SUMS
index c94e5638..ad8e180c 100644
--- a/pkg/contrib/src/njs/SHA512SUMS
+++ b/pkg/contrib/src/njs/SHA512SUMS
@@ -1 +1 @@
-9cac2ced65bbfd712f7797f2bfa3fb20509a7e7bd68e8621d5fad32270f6d20a015d707665222559a72f525618bc91e09986a7bedce28af5f0fec9c20be41452 njs-0.7.12.tar.gz
+200f3ae1e1909f0d8086e2fbfbd6b8654e596f3ad2e4cf4d863e201cfcb2f86a419fa9061067cbededf6a8c792c1a5ecf60c3a4c983af044c179bb9fe619eea5 njs-0.8.0.tar.gz
diff --git a/pkg/contrib/src/njs/version b/pkg/contrib/src/njs/version
index 64999f82..8c9ee6ba 100644
--- a/pkg/contrib/src/njs/version
+++ b/pkg/contrib/src/njs/version
@@ -1 +1 @@
-NJS_VERSION := 0.7.12
+NJS_VERSION := 0.8.0
diff --git a/pkg/contrib/src/wasi-sysroot/Makefile b/pkg/contrib/src/wasi-sysroot/Makefile
new file mode 100644
index 00000000..fcfb8df3
--- /dev/null
+++ b/pkg/contrib/src/wasi-sysroot/Makefile
@@ -0,0 +1,17 @@
+# wasi-sysroot
+
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
+WASI_SYSROOT_URL := https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WASI_SYSROOT_VERSION_MAJOR)/wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz
+
+PKGS += wasi-sysroot
+
+$(TARBALLS)/wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz:
+ $(call download_pkg,$(WASI_SYSROOT_URL),wasi-sysroot)
+
+.sum-wasi-sysroot: wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz
+
+wasi-sysroot: wasi-sysroot-$(WASI_SYSROOT_VERSION_MAJOR).$(WASI_SYSROOT_VERSION_MINOR).tar.gz .sum-wasi-sysroot
+ $(UNPACK)
+
+.wasi-sysroot: wasi-sysroot
+ touch $@
diff --git a/pkg/contrib/src/wasi-sysroot/SHA512SUMS b/pkg/contrib/src/wasi-sysroot/SHA512SUMS
new file mode 100644
index 00000000..a1e71fff
--- /dev/null
+++ b/pkg/contrib/src/wasi-sysroot/SHA512SUMS
@@ -0,0 +1 @@
+ad4ad629d02f01f3d2eb977dd0bc43091b0f11ed1b5dd9fdb3580e4cf49c132f6cb4982ae80eabf638f0d08d0c4c7df40cceb2be8f9d2c29abc35b8564ffda42 wasi-sysroot-20.0.tar.gz
diff --git a/pkg/contrib/src/wasi-sysroot/version b/pkg/contrib/src/wasi-sysroot/version
new file mode 100644
index 00000000..919c7098
--- /dev/null
+++ b/pkg/contrib/src/wasi-sysroot/version
@@ -0,0 +1,2 @@
+WASI_SYSROOT_VERSION_MAJOR := 20
+WASI_SYSROOT_VERSION_MINOR := 0
diff --git a/pkg/contrib/src/wasmtime/Makefile b/pkg/contrib/src/wasmtime/Makefile
new file mode 100644
index 00000000..11797fee
--- /dev/null
+++ b/pkg/contrib/src/wasmtime/Makefile
@@ -0,0 +1,30 @@
+# wasmtime
+
+include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/version
+WASMTIME_URL := https://github.com/bytecodealliance/wasmtime/releases/download/v$(WASMTIME_VERSION)/wasmtime-v$(WASMTIME_VERSION)-src.tar.gz
+
+PKGS += wasmtime
+
+ifeq ($(shell which cargo >/dev/null 2>&1 || echo FAIL),)
+CARGO = cargo
+else
+CARGO = $(error Cargo (Rust package manager) not found)
+endif
+
+ifeq ($(shell uname -s),Linux)
+WASMTIME_ARGS=-Clink-arg=-Wl,-soname,libwasmtime.so
+endif
+
+$(TARBALLS)/wasmtime-v$(WASMTIME_VERSION)-src.tar.gz:
+ $(call download_pkg,$(WASMTIME_URL),wasmtime)
+
+.sum-wasmtime: wasmtime-v$(WASMTIME_VERSION)-src.tar.gz
+
+wasmtime: wasmtime-v$(WASMTIME_VERSION)-src.tar.gz .sum-wasmtime
+ $(UNPACK)
+ $(MOVE)
+
+.wasmtime: wasmtime
+ cd $< && $(CARGO) rustc --release -p wasmtime-c-api -- $(WASMTIME_ARGS)
+ cp $</crates/c-api/wasm-c-api/include/wasm.h $</crates/c-api/include/
+ touch $@
diff --git a/pkg/contrib/src/wasmtime/SHA512SUMS b/pkg/contrib/src/wasmtime/SHA512SUMS
new file mode 100644
index 00000000..35e0e47f
--- /dev/null
+++ b/pkg/contrib/src/wasmtime/SHA512SUMS
@@ -0,0 +1 @@
+4b67ba0742da0558efffe1dbde5512dc5f0201fad25f1027d277758e76778b2add11528dbe3f5b7759f2386859b52aea3a0526abaa481c2ed91eb56c5a531b49 wasmtime-v11.0.1-src.tar.gz
diff --git a/pkg/contrib/src/wasmtime/version b/pkg/contrib/src/wasmtime/version
new file mode 100644
index 00000000..1debf1ff
--- /dev/null
+++ b/pkg/contrib/src/wasmtime/version
@@ -0,0 +1 @@
+WASMTIME_VERSION := 11.0.1
diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile
index 044b7226..f82441c6 100644
--- a/pkg/deb/Makefile
+++ b/pkg/deb/Makefile
@@ -32,6 +32,7 @@ include Makefile.jsc17
include Makefile.jsc18
include Makefile.jsc19
include Makefile.jsc20
+include Makefile.wasm
endif
# Ubuntu 22.10
@@ -47,6 +48,7 @@ include Makefile.jsc11
include Makefile.jsc17
include Makefile.jsc18
include Makefile.jsc19
+include Makefile.wasm
endif
# Ubuntu 22.04
@@ -61,6 +63,7 @@ include Makefile.jsc-common
include Makefile.jsc11
include Makefile.jsc17
include Makefile.jsc18
+include Makefile.wasm
endif
# Ubuntu 21.10
@@ -77,6 +80,7 @@ include Makefile.jsc11
include Makefile.jsc16
include Makefile.jsc17
include Makefile.jsc18
+include Makefile.wasm
endif
# Ubuntu 20.04
@@ -89,6 +93,7 @@ include Makefile.perl
include Makefile.ruby
include Makefile.jsc-common
include Makefile.jsc11
+include Makefile.wasm
endif
# Ubuntu 18.04
@@ -104,6 +109,19 @@ include Makefile.ruby
include Makefile.jsc-common
include Makefile.jsc8
include Makefile.jsc11
+include Makefile.wasm
+endif
+
+# Debian 12
+ifeq ($(CODENAME),bookworm)
+include Makefile.php
+include Makefile.python311
+include Makefile.go
+include Makefile.perl
+include Makefile.ruby
+include Makefile.jsc-common
+include Makefile.jsc17
+include Makefile.wasm
endif
# Debian 12
@@ -127,6 +145,7 @@ include Makefile.perl
include Makefile.ruby
include Makefile.jsc-common
include Makefile.jsc11
+include Makefile.wasm
endif
# Debian 10
@@ -139,13 +158,16 @@ include Makefile.perl
include Makefile.ruby
include Makefile.jsc-common
include Makefile.jsc11
+include Makefile.wasm
endif
CONFIGURE_ARGS_COMMON=\
--prefix=/usr \
--statedir=/var/lib/unit \
--control="unix:/var/run/control.unit.sock" \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -232,7 +254,7 @@ debuild/unit_$(VERSION).orig.tar.gz: | debuild/$(SRCDIR)/debian
unit: check-build-depends-unit debuild/unit_$(VERSION).orig.tar.gz debuild/$(SRCDIR)/debian/changelog
@echo "===> Building $@ package"
- cd debuild/$(SRCDIR) && debuild -us -uc
+ cd debuild/$(SRCDIR) && debuild --preserve-envvar PATH --preserve-envvar RUSTUP_HOME -us -uc
mkdir -p debs
find debuild/ -maxdepth 1 -type f -exec cp {} debs/ \;
ln -s debuild/$(SRCDIR)/build $@
@@ -305,7 +327,7 @@ endif
unit-%: check-build-depends-% | debuild-%
@echo "===> Building $@ package"
- cd debuild-$*/$(SRCDIR) && debuild -us -uc
+ cd debuild-$*/$(SRCDIR) && debuild --preserve-envvar PATH --preserve-envvar RUSTUP_HOME -us -uc
mkdir -p debs
find debuild-$*/ -maxdepth 1 -type f -exec cp {} debs/ \;
ln -s debuild-$*/$(SRCDIR)/build $@
diff --git a/pkg/deb/Makefile.wasm b/pkg/deb/Makefile.wasm
new file mode 100644
index 00000000..da028f19
--- /dev/null
+++ b/pkg/deb/Makefile.wasm
@@ -0,0 +1,47 @@
+MODULES+= wasm
+MODULE_SUFFIX_wasm= wasm
+
+MODULE_SUMMARY_wasm= WASM module for NGINX Unit
+
+MODULE_VERSION_wasm= $(VERSION)
+MODULE_RELEASE_wasm= 1
+
+MODULE_CONFARGS_wasm= wasm --include-path=\$$(CURDIR)/pkg/contrib/wasmtime/crates/c-api/include --lib-path=\$$(CURDIR)/pkg/contrib/wasmtime/target/release
+MODULE_MAKEARGS_wasm= wasm
+MODULE_INSTARGS_wasm= wasm-install
+
+MODULE_SOURCES_wasm=
+
+BUILD_DEPENDS_wasm=
+MODULE_BUILD_DEPENDS_wasm=
+MODULE_DEPENDS_wasm=
+
+BUILD_DEPENDS+= $(BUILD_DEPENDS_wasm)
+
+define MODULE_PREBUILD_wasm
+ \$$(MAKE) -C pkg/contrib .wasmtime
+endef
+export MODULE_PREBUILD_wasm
+
+define MODULE_PREINSTALL_wasm
+endef
+export MODULE_PREINSTALL_wasm
+
+define MODULE_POSTINSTALL_wasm
+ mkdir -p debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/
+ install -m 755 -p pkg/contrib/wasmtime/target/release/libwasmtime.so debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/
+endef
+export MODULE_POSTINSTALL_wasm
+
+define MODULE_POST_wasm
+cat <<BANNER
+----------------------------------------------------------------------
+
+The $(MODULE_SUMMARY_wasm) has been installed.
+
+Online documentation is available at https://unit.nginx.org
+
+----------------------------------------------------------------------
+BANNER
+endef
+export MODULE_POST_wasm
diff --git a/pkg/deb/debian.module/copyright.unit-jsc11 b/pkg/deb/debian.module/copyright.unit-jsc11
index b2e4a117..e11b64d3 100644
--- a/pkg/deb/debian.module/copyright.unit-jsc11
+++ b/pkg/deb/debian.module/copyright.unit-jsc11
@@ -1,12 +1,15 @@
NGINX Unit.
- Copyright 2017-2022 NGINX, Inc.
+ Copyright 2017-2023 NGINX, Inc.
+ Copyright 2017-2023 Andrei Zeliankou
+ Copyright 2018-2023 Konstantin Pavlov
+ Copyright 2021-2023 Zhidao Hong
+ Copyright 2021-2023 Alejandro Colomar
+ Copyright 2022-2023 Andrew Clayton
+ Copyright 2022-2023 Liam Crilly
Copyright 2017-2022 Valentin V. Bartenev
Copyright 2017-2022 Max Romanov
- Copyright 2017-2022 Andrei Zeliankou
- Copyright 2018-2022 Konstantin Pavlov
- Copyright 2021-2022 Zhidao Hong
Copyright 2021-2022 Oisín Canty
Copyright 2017-2021 Igor Sysoev
Copyright 2017-2021 Andrei Belov
diff --git a/pkg/deb/debian.module/copyright.unit-jsc8 b/pkg/deb/debian.module/copyright.unit-jsc8
index 1dab9cce..1d267021 100644
--- a/pkg/deb/debian.module/copyright.unit-jsc8
+++ b/pkg/deb/debian.module/copyright.unit-jsc8
@@ -1,12 +1,15 @@
NGINX Unit.
- Copyright 2017-2022 NGINX, Inc.
+ Copyright 2017-2023 NGINX, Inc.
+ Copyright 2017-2023 Andrei Zeliankou
+ Copyright 2018-2023 Konstantin Pavlov
+ Copyright 2021-2023 Zhidao Hong
+ Copyright 2021-2023 Alejandro Colomar
+ Copyright 2022-2023 Andrew Clayton
+ Copyright 2022-2023 Liam Crilly
Copyright 2017-2022 Valentin V. Bartenev
Copyright 2017-2022 Max Romanov
- Copyright 2017-2022 Andrei Zeliankou
- Copyright 2018-2022 Konstantin Pavlov
- Copyright 2021-2022 Zhidao Hong
Copyright 2021-2022 Oisín Canty
Copyright 2017-2021 Igor Sysoev
Copyright 2017-2021 Andrei Belov
diff --git a/pkg/deb/debian.module/rules.in b/pkg/deb/debian.module/rules.in
index 861a9c00..7814fbfd 100755
--- a/pkg/deb/debian.module/rules.in
+++ b/pkg/deb/debian.module/rules.in
@@ -17,6 +17,7 @@ BASEDIR = $(CURDIR)
config.env.%:
dh_testdir
+%%MODULE_PREBUILD%%
mkdir -p $(BUILDDIR_$*)
cp -Pa $(CURDIR)/auto $(BUILDDIR_$*)/
cp -Pa $(CURDIR)/configure $(BUILDDIR_$*)/
diff --git a/pkg/deb/debian/control.in b/pkg/deb/debian/control.in
index 579f41e3..bc757233 100644
--- a/pkg/deb/debian/control.in
+++ b/pkg/deb/debian/control.in
@@ -6,7 +6,9 @@ Build-Depends: debhelper (>= 11),
linux-libc-dev,
libssl-dev,
libpcre2-dev,
- pkg-config
+ pkg-config,
+ clang,
+ llvm
Standards-Version: 4.1.4
Homepage: https://unit.nginx.org
diff --git a/pkg/deb/debian/copyright b/pkg/deb/debian/copyright
index 487c92c5..692ae2e0 100644
--- a/pkg/deb/debian/copyright
+++ b/pkg/deb/debian/copyright
@@ -1,12 +1,15 @@
NGINX Unit.
- Copyright 2017-2022 NGINX, Inc.
+ Copyright 2017-2023 NGINX, Inc.
+ Copyright 2017-2023 Andrei Zeliankou
+ Copyright 2018-2023 Konstantin Pavlov
+ Copyright 2021-2023 Zhidao Hong
+ Copyright 2021-2023 Alejandro Colomar
+ Copyright 2022-2023 Andrew Clayton
+ Copyright 2022-2023 Liam Crilly
Copyright 2017-2022 Valentin V. Bartenev
Copyright 2017-2022 Max Romanov
- Copyright 2017-2022 Andrei Zeliankou
- Copyright 2018-2022 Konstantin Pavlov
- Copyright 2021-2022 Zhidao Hong
Copyright 2021-2022 Oisín Canty
Copyright 2017-2021 Igor Sysoev
Copyright 2017-2021 Andrei Belov
diff --git a/pkg/deb/debian/dirs b/pkg/deb/debian/dirs
index 2568bac1..552cdf7c 100644
--- a/pkg/deb/debian/dirs
+++ b/pkg/deb/debian/dirs
@@ -1,4 +1,5 @@
usr/bin
usr/sbin
usr/lib/unit
+usr/include/unit
var/lib/unit
diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in
index 0d7cf830..55a4ebec 100644
--- a/pkg/deb/debian/rules.in
+++ b/pkg/deb/debian/rules.in
@@ -25,6 +25,11 @@ njs:
cd pkg/contrib && make .njs
touch $@
+libunit-wasm:
+ dh_testdir
+ cd pkg/contrib && make .libunit-wasm
+ touch $@
+
config.env.%: njs
dh_testdir
mkdir -p $(BUILDDIR_$*)
@@ -92,7 +97,7 @@ build-arch: build-arch.unit build-arch.unit_debug
dh_testdir
touch $@
-build: build-arch build-indep
+build: build-arch build-indep libunit-wasm
dh_testdir
touch $@
@@ -123,6 +128,9 @@ install: build do.tests
install -m 644 README.md $(INSTALLDIR)/usr/share/doc/unit/
install -m 644 CONTRIBUTING.md $(INSTALLDIR)/usr/share/doc/unit/
install -m 644 NOTICE $(INSTALLDIR)/usr/share/doc/unit/
+ mkdir -p $(INSTALLDIR_dev)/usr/include/unit
+ install -m644 $(CURDIR)/pkg/contrib/libunit-wasm/src/c/libunit-wasm.a $(INSTALLDIR_dev)/usr/lib/$(DEB_HOST_MULTIARCH)/libunit-wasm.a
+ install -m644 $(CURDIR)/pkg/contrib/libunit-wasm/src/c/include/unit/unit-wasm.h $(INSTALLDIR_dev)/usr/include/unit/
binary-indep: build install
dh_testdir
diff --git a/pkg/docker/Dockerfile.go1.20 b/pkg/docker/Dockerfile.go1.20
index 50b4d5b3..98f6d92f 100644
--- a/pkg/docker/Dockerfile.go1.20
+++ b/pkg/docker/Dockerfile.go1.20
@@ -1,19 +1,21 @@
FROM golang:1.20-bullseye
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (go1.20)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure go --go-path=$GOPATH \
&& make -j $NCPU go-install-src libunit-install \
@@ -49,7 +54,7 @@ RUN set -ex \
&& ./configure go --go-path=$GOPATH \
&& make -j $NCPU go-install-src libunit-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
@@ -57,7 +62,7 @@ RUN set -ex \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
&& /bin/true \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.go1.21 b/pkg/docker/Dockerfile.go1.21
new file mode 100644
index 00000000..18d3cc7b
--- /dev/null
+++ b/pkg/docker/Dockerfile.go1.21
@@ -0,0 +1,89 @@
+FROM golang:1.21-bullseye
+
+LABEL org.opencontainers.image.title="Unit (go1.21)"
+LABEL org.opencontainers.image.description="Official build of Unit for Docker."
+LABEL org.opencontainers.image.url="https://unit.nginx.org"
+LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
+LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
+LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
+LABEL org.opencontainers.image.version="1.31.0"
+
+RUN set -ex \
+ && savedAptMark="$(apt-mark showmanual)" \
+ && apt-get update \
+ && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
+ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
+ && cd unit \
+ && NCPU="$(getconf _NPROCESSORS_ONLN)" \
+ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
+ && CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
+ && LD_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,--as-needed -pie" dpkg-buildflags --get LDFLAGS)" \
+ && CONFIGURE_ARGS_MODULES="--prefix=/usr \
+ --statedir=/var/lib/unit \
+ --control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
+ --pid=/var/run/unit.pid \
+ --logdir=/var/log \
+ --log=/var/log/unit.log \
+ --tmpdir=/var/tmp \
+ --user=unit \
+ --group=unit \
+ --openssl \
+ --libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
+ && CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
+ --njs" \
+ && make -j $NCPU -C pkg/contrib .njs \
+ && export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd-debug \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/modules \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd \
+ && make clean \
+ && /bin/true \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && ./configure go --go-path=$GOPATH \
+ && make -j $NCPU go-install-src libunit-install \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
+ && ./configure go --go-path=$GOPATH \
+ && make -j $NCPU go-install-src libunit-install \
+ && cd \
+ && rm -rf /usr/src/unit \
+ && for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
+ ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
+ done \
+ && apt-mark showmanual | xargs apt-mark auto > /dev/null \
+ && { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
+ && /bin/true \
+ && mkdir -p /var/lib/unit/ \
+ && mkdir -p /docker-entrypoint.d/ \
+ && groupadd --gid 999 unit \
+ && useradd \
+ --uid 999 \
+ --gid unit \
+ --no-create-home \
+ --home /nonexistent \
+ --comment "unit user" \
+ --shell /bin/false \
+ unit \
+ && apt-get update \
+ && apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
+ && apt-get purge -y --auto-remove build-essential \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -f /requirements.apt \
+ && ln -sf /dev/stdout /var/log/unit.log
+
+COPY docker-entrypoint.sh /usr/local/bin/
+COPY welcome.* /usr/share/unit/welcome/
+
+STOPSIGNAL SIGTERM
+
+ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
+EXPOSE 80
+CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
diff --git a/pkg/docker/Dockerfile.jsc11 b/pkg/docker/Dockerfile.jsc11
index bd987ae5..e7a057bd 100644
--- a/pkg/docker/Dockerfile.jsc11
+++ b/pkg/docker/Dockerfile.jsc11
@@ -1,19 +1,21 @@
FROM eclipse-temurin:11-jdk-jammy
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (jsc11)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure java --jars=/usr/share/unit-jsc-common/ \
&& make -j $NCPU java-shared-install java-install \
@@ -49,15 +54,15 @@ RUN set -ex \
&& ./configure java --jars=/usr/share/unit-jsc-common/ \
&& make -j $NCPU java-shared-install java-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
- && /bin/true \
+ && rm -rf /root/.m2 \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.minimal b/pkg/docker/Dockerfile.minimal
index 06a85b22..8c5ce0d5 100644
--- a/pkg/docker/Dockerfile.minimal
+++ b/pkg/docker/Dockerfile.minimal
@@ -1,19 +1,21 @@
FROM debian:bullseye-slim
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (minimal)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure \
&& make -j $NCPU version \
@@ -49,7 +54,7 @@ RUN set -ex \
&& ./configure \
&& make -j $NCPU version \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
@@ -57,7 +62,7 @@ RUN set -ex \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
&& /bin/true \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.node18 b/pkg/docker/Dockerfile.node18
index b3fb46d3..735342dd 100644
--- a/pkg/docker/Dockerfile.node18
+++ b/pkg/docker/Dockerfile.node18
@@ -1,19 +1,21 @@
FROM node:18-bullseye
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (node18)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,23 +45,24 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && npm -g install node-gyp \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
- && ./configure nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp \
+ && ./configure nodejs --node-gyp=/usr/local/bin/node-gyp \
&& make -j $NCPU node node-install libunit-install \
&& make clean \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
- && ./configure nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp \
+ && ./configure nodejs --node-gyp=/usr/local/bin/node-gyp \
&& make -j $NCPU node node-install libunit-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
- && /bin/true \
+ && rm -rf /root/.cache/ && rm -rf /root/.npm \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.node20 b/pkg/docker/Dockerfile.node20
new file mode 100644
index 00000000..f291ccfc
--- /dev/null
+++ b/pkg/docker/Dockerfile.node20
@@ -0,0 +1,89 @@
+FROM node:20-bullseye
+
+LABEL org.opencontainers.image.title="Unit (node20)"
+LABEL org.opencontainers.image.description="Official build of Unit for Docker."
+LABEL org.opencontainers.image.url="https://unit.nginx.org"
+LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
+LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
+LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
+LABEL org.opencontainers.image.version="1.31.0"
+
+RUN set -ex \
+ && savedAptMark="$(apt-mark showmanual)" \
+ && apt-get update \
+ && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
+ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
+ && cd unit \
+ && NCPU="$(getconf _NPROCESSORS_ONLN)" \
+ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
+ && CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
+ && LD_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,--as-needed -pie" dpkg-buildflags --get LDFLAGS)" \
+ && CONFIGURE_ARGS_MODULES="--prefix=/usr \
+ --statedir=/var/lib/unit \
+ --control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
+ --pid=/var/run/unit.pid \
+ --logdir=/var/log \
+ --log=/var/log/unit.log \
+ --tmpdir=/var/tmp \
+ --user=unit \
+ --group=unit \
+ --openssl \
+ --libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
+ && CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
+ --njs" \
+ && make -j $NCPU -C pkg/contrib .njs \
+ && export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd-debug \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/modules \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd \
+ && make clean \
+ && npm -g install node-gyp \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && ./configure nodejs --node-gyp=/usr/local/bin/node-gyp \
+ && make -j $NCPU node node-install libunit-install \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
+ && ./configure nodejs --node-gyp=/usr/local/bin/node-gyp \
+ && make -j $NCPU node node-install libunit-install \
+ && cd \
+ && rm -rf /usr/src/unit \
+ && for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
+ ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
+ done \
+ && apt-mark showmanual | xargs apt-mark auto > /dev/null \
+ && { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
+ && rm -rf /root/.cache/ && rm -rf /root/.npm \
+ && mkdir -p /var/lib/unit/ \
+ && mkdir -p /docker-entrypoint.d/ \
+ && groupadd --gid 999 unit \
+ && useradd \
+ --uid 999 \
+ --gid unit \
+ --no-create-home \
+ --home /nonexistent \
+ --comment "unit user" \
+ --shell /bin/false \
+ unit \
+ && apt-get update \
+ && apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
+ && apt-get purge -y --auto-remove build-essential \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -f /requirements.apt \
+ && ln -sf /dev/stdout /var/log/unit.log
+
+COPY docker-entrypoint.sh /usr/local/bin/
+COPY welcome.* /usr/share/unit/welcome/
+
+STOPSIGNAL SIGTERM
+
+ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
+EXPOSE 80
+CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
diff --git a/pkg/docker/Dockerfile.perl5.36 b/pkg/docker/Dockerfile.perl5.36
index 2dc31e53..2db7506d 100644
--- a/pkg/docker/Dockerfile.perl5.36
+++ b/pkg/docker/Dockerfile.perl5.36
@@ -1,19 +1,21 @@
FROM perl:5.36-bullseye
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (perl5.36)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure perl \
&& make -j $NCPU perl-install \
@@ -49,7 +54,7 @@ RUN set -ex \
&& ./configure perl \
&& make -j $NCPU perl-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
@@ -57,7 +62,7 @@ RUN set -ex \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
&& /bin/true \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.perl5.38 b/pkg/docker/Dockerfile.perl5.38
new file mode 100644
index 00000000..bd653cb1
--- /dev/null
+++ b/pkg/docker/Dockerfile.perl5.38
@@ -0,0 +1,89 @@
+FROM perl:5.38-bullseye
+
+LABEL org.opencontainers.image.title="Unit (perl5.38)"
+LABEL org.opencontainers.image.description="Official build of Unit for Docker."
+LABEL org.opencontainers.image.url="https://unit.nginx.org"
+LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
+LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
+LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
+LABEL org.opencontainers.image.version="1.31.0"
+
+RUN set -ex \
+ && savedAptMark="$(apt-mark showmanual)" \
+ && apt-get update \
+ && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
+ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
+ && cd unit \
+ && NCPU="$(getconf _NPROCESSORS_ONLN)" \
+ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
+ && CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
+ && LD_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,--as-needed -pie" dpkg-buildflags --get LDFLAGS)" \
+ && CONFIGURE_ARGS_MODULES="--prefix=/usr \
+ --statedir=/var/lib/unit \
+ --control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
+ --pid=/var/run/unit.pid \
+ --logdir=/var/log \
+ --log=/var/log/unit.log \
+ --tmpdir=/var/tmp \
+ --user=unit \
+ --group=unit \
+ --openssl \
+ --libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
+ && CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
+ --njs" \
+ && make -j $NCPU -C pkg/contrib .njs \
+ && export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd-debug \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/modules \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd \
+ && make clean \
+ && /bin/true \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && ./configure perl \
+ && make -j $NCPU perl-install \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
+ && ./configure perl \
+ && make -j $NCPU perl-install \
+ && cd \
+ && rm -rf /usr/src/unit \
+ && for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
+ ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
+ done \
+ && apt-mark showmanual | xargs apt-mark auto > /dev/null \
+ && { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
+ && /bin/true \
+ && mkdir -p /var/lib/unit/ \
+ && mkdir -p /docker-entrypoint.d/ \
+ && groupadd --gid 999 unit \
+ && useradd \
+ --uid 999 \
+ --gid unit \
+ --no-create-home \
+ --home /nonexistent \
+ --comment "unit user" \
+ --shell /bin/false \
+ unit \
+ && apt-get update \
+ && apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
+ && apt-get purge -y --auto-remove build-essential \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -f /requirements.apt \
+ && ln -sf /dev/stdout /var/log/unit.log
+
+COPY docker-entrypoint.sh /usr/local/bin/
+COPY welcome.* /usr/share/unit/welcome/
+
+STOPSIGNAL SIGTERM
+
+ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
+EXPOSE 80
+CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
diff --git a/pkg/docker/Dockerfile.php8.2 b/pkg/docker/Dockerfile.php8.2
index fcf3f59e..bd27a4dd 100644
--- a/pkg/docker/Dockerfile.php8.2
+++ b/pkg/docker/Dockerfile.php8.2
@@ -1,19 +1,21 @@
FROM php:8.2-cli-bullseye
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (php8.2)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure php \
&& make -j $NCPU php-install \
@@ -49,7 +54,7 @@ RUN set -ex \
&& ./configure php \
&& make -j $NCPU php-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
@@ -57,7 +62,7 @@ RUN set -ex \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
&& ldconfig \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.python3.11 b/pkg/docker/Dockerfile.python3.11
index 89cd315a..cdc96434 100644
--- a/pkg/docker/Dockerfile.python3.11
+++ b/pkg/docker/Dockerfile.python3.11
@@ -1,19 +1,21 @@
FROM python:3.11-bullseye
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (python3.11)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure python --config=/usr/local/bin/python3-config \
&& make -j $NCPU python3-install \
@@ -49,7 +54,7 @@ RUN set -ex \
&& ./configure python --config=/usr/local/bin/python3-config \
&& make -j $NCPU python3-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
@@ -57,7 +62,7 @@ RUN set -ex \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
&& /bin/true \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.ruby3.2 b/pkg/docker/Dockerfile.ruby3.2
index 4a6b60e4..8b870756 100644
--- a/pkg/docker/Dockerfile.ruby3.2
+++ b/pkg/docker/Dockerfile.ruby3.2
@@ -1,19 +1,21 @@
FROM ruby:3.2-bullseye
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (ruby3.2)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
-LABEL org.opencontainers.image.version="1.30.0"
+LABEL org.opencontainers.image.version="1.31.0"
RUN set -ex \
&& savedAptMark="$(apt-mark showmanual)" \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
- && hg clone -u 1.30.0-1 https://hg.nginx.org/unit \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
&& DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && /bin/true \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure ruby \
&& make -j $NCPU ruby-install \
@@ -49,15 +54,15 @@ RUN set -ex \
&& ./configure ruby \
&& make -j $NCPU ruby-install \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
&& apt-mark showmanual | xargs apt-mark auto > /dev/null \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
- && gem install rack \
+ && gem install rack && rm -rf /root/.local \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/docker/Dockerfile.wasm b/pkg/docker/Dockerfile.wasm
new file mode 100644
index 00000000..852bc5d0
--- /dev/null
+++ b/pkg/docker/Dockerfile.wasm
@@ -0,0 +1,109 @@
+FROM debian:bullseye-slim
+
+LABEL org.opencontainers.image.title="Unit (wasm)"
+LABEL org.opencontainers.image.description="Official build of Unit for Docker."
+LABEL org.opencontainers.image.url="https://unit.nginx.org"
+LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
+LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images"
+LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers <docker-maint@nginx.com>"
+LABEL org.opencontainers.image.version="1.31.0"
+
+RUN set -ex \
+ && savedAptMark="$(apt-mark showmanual)" \
+ && apt-get update \
+ && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
+ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
+ && hg clone -u 1.31.0-1 https://hg.nginx.org/unit \
+ && cd unit \
+ && NCPU="$(getconf _NPROCESSORS_ONLN)" \
+ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \
+ && CC_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_CFLAGS_MAINT_APPEND="-Wp,-D_FORTIFY_SOURCE=2 -fPIC" dpkg-buildflags --get CFLAGS)" \
+ && LD_OPT="$(DEB_BUILD_MAINT_OPTIONS="hardening=+all,-pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,--as-needed -pie" dpkg-buildflags --get LDFLAGS)" \
+ && CONFIGURE_ARGS_MODULES="--prefix=/usr \
+ --statedir=/var/lib/unit \
+ --control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
+ --pid=/var/run/unit.pid \
+ --logdir=/var/log \
+ --log=/var/log/unit.log \
+ --tmpdir=/var/tmp \
+ --user=unit \
+ --group=unit \
+ --openssl \
+ --libdir=/usr/lib/$DEB_HOST_MULTIARCH" \
+ && CONFIGURE_ARGS="$CONFIGURE_ARGS_MODULES \
+ --njs" \
+ && make -j $NCPU -C pkg/contrib .njs \
+ && export PKG_CONFIG_PATH=$(pwd)/pkg/contrib/njs/build \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd-debug \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS --cc-opt="$CC_OPT" --ld-opt="$LD_OPT" --modulesdir=/usr/lib/unit/modules \
+ && make -j $NCPU unitd \
+ && install -pm755 build/sbin/unitd /usr/sbin/unitd \
+ && make clean \
+ && export RUST_VERSION=1.71.0 \
+ && export RUSTUP_HOME=/usr/src/unit/rustup \
+ && export CARGO_HOME=/usr/src/unit/cargo \
+ && export PATH=/usr/src/unit/cargo/bin:$PATH \
+ && dpkgArch="$(dpkg --print-architecture)" \
+ && case "${dpkgArch##*-}" in \
+ amd64) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db" ;; \
+ arm64) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800" ;; \
+ *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
+ esac \
+ && url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init" \
+ && curl -L -O "$url" \
+ && echo "${rustupSha256} *rustup-init" | sha256sum -c - \
+ && chmod +x rustup-init \
+ && ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} \
+ && rm rustup-init \
+ && rustup --version \
+ && cargo --version \
+ && rustc --version \
+ && make -C pkg/contrib .wasmtime \
+ && install -pm 755 pkg/contrib/wasmtime/target/release/libwasmtime.so /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
+ && ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \
+ && make -j $NCPU wasm-install \
+ && make clean \
+ && ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
+ && ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \
+ && make -j $NCPU wasm-install \
+ && cd \
+ && rm -rf /usr/src/unit \
+ && for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
+ ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
+ done \
+ && apt-mark showmanual | xargs apt-mark auto > /dev/null \
+ && { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
+ && /bin/true \
+ && mkdir -p /var/lib/unit/ \
+ && mkdir -p /docker-entrypoint.d/ \
+ && groupadd --gid 999 unit \
+ && useradd \
+ --uid 999 \
+ --gid unit \
+ --no-create-home \
+ --home /nonexistent \
+ --comment "unit user" \
+ --shell /bin/false \
+ unit \
+ && apt-get update \
+ && apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
+ && apt-get purge -y --auto-remove build-essential \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -f /requirements.apt \
+ && ln -sf /dev/stdout /var/log/unit.log
+
+COPY docker-entrypoint.sh /usr/local/bin/
+COPY welcome.* /usr/share/unit/welcome/
+
+STOPSIGNAL SIGTERM
+
+ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
+EXPOSE 80
+CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
diff --git a/pkg/docker/Makefile b/pkg/docker/Makefile
index cb801253..237228a9 100644
--- a/pkg/docker/Makefile
+++ b/pkg/docker/Makefile
@@ -8,7 +8,7 @@ DEFAULT_VERSION := $(NXT_VERSION)
VERSION ?= $(DEFAULT_VERSION)
PATCHLEVEL ?= 1
-MODULES ?= go jsc node perl php python ruby
+MODULES ?= go jsc node perl php python ruby wasm
VARIANT ?= bullseye
@@ -17,34 +17,39 @@ CONTAINER_minimal ?= debian:$(VARIANT)-slim
CONFIGURE_minimal ?=
INSTALL_minimal ?= version
RUN_minimal ?= /bin/true
+MODULE_PREBUILD_minimal ?= /bin/true
-VERSIONS_go ?= 1.20
+VERSIONS_go ?= 1.20 1.21
VARIANT_go ?= $(VARIANT)
$(foreach goversion, $(VERSIONS_go), $(eval CONTAINER_go$(goversion) = golang:$(goversion)-$(VARIANT_go)))
CONFIGURE_go ?= go --go-path=$$GOPATH
INSTALL_go ?= go-install-src libunit-install
RUN_go ?= /bin/true
+MODULE_PREBUILD_go ?= /bin/true
VERSIONS_jsc ?= 11
VARIANT_jsc ?= jammy
$(foreach jscversion, $(VERSIONS_jsc), $(eval CONTAINER_jsc$(jscversion) = eclipse-temurin:$(jscversion)-jdk-$(VARIANT_jsc)))
CONFIGURE_jsc ?= java --jars=/usr/share/unit-jsc-common/
INSTALL_jsc ?= java-shared-install java-install
-RUN_jsc ?= /bin/true
+RUN_jsc ?= rm -rf /root/.m2
+MODULE_PREBUILD_jsc ?= /bin/true
-VERSIONS_node ?= 18
+VERSIONS_node ?= 18 20
VARIANT_node ?= $(VARIANT)
$(foreach nodeversion, $(VERSIONS_node), $(eval CONTAINER_node$(nodeversion) = node:$(nodeversion)-$(VARIANT_node)))
-CONFIGURE_node ?= nodejs --node-gyp=/usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp
+CONFIGURE_node ?= nodejs --node-gyp=/usr/local/bin/node-gyp
INSTALL_node ?= node node-install libunit-install
-RUN_node ?= /bin/true
+RUN_node ?= rm -rf /root/.cache/ \&\& rm -rf /root/.npm
+MODULE_PREBUILD_node ?= npm -g install node-gyp
-VERSIONS_perl ?= 5.36
+VERSIONS_perl ?= 5.36 5.38
VARIANT_perl ?= $(VARIANT)
$(foreach perlversion, $(VERSIONS_perl), $(eval CONTAINER_perl$(perlversion) = perl:$(perlversion)-$(VARIANT_perl)))
CONFIGURE_perl ?= perl
INSTALL_perl ?= perl-install
RUN_perl ?= /bin/true
+MODULE_PREBUILD_perl ?= /bin/true
VERSIONS_php ?= 8.2
VARIANT_php ?= cli-$(VARIANT)
@@ -52,6 +57,7 @@ $(foreach phpversion, $(VERSIONS_php), $(eval CONTAINER_php$(phpversion) = php:$
CONFIGURE_php ?= php
INSTALL_php ?= php-install
RUN_php ?= ldconfig
+MODULE_PREBUILD_php ?= /bin/true
VERSIONS_python ?= 3.11
VARIANT_python ?= $(VARIANT)
@@ -59,18 +65,49 @@ $(foreach pythonversion, $(VERSIONS_python), $(eval CONTAINER_python$(pythonvers
CONFIGURE_python ?= python --config=/usr/local/bin/python3-config
INSTALL_python ?= python3-install
RUN_python ?= /bin/true
+MODULE_PREBUILD_python ?= /bin/true
VERSIONS_ruby ?= 3.2
VARIANT_ruby ?= $(VARIANT)
$(foreach rubyversion, $(VERSIONS_ruby), $(eval CONTAINER_ruby$(rubyversion) = ruby:$(rubyversion)-$(VARIANT_ruby)))
CONFIGURE_ruby ?= ruby
INSTALL_ruby ?= ruby-install
-RUN_ruby ?= gem install rack
+RUN_ruby ?= gem install rack \&\& rm -rf /root/.local
+MODULE_PREBUILD_ruby ?= /bin/true
+
+VERSIONS_wasm ?=
+CONTAINER_wasm ?= debian:$(VARIANT)-slim
+CONFIGURE_wasm ?= wasm --include-path=\`pwd\`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/
+INSTALL_wasm ?= wasm-install
+RUN_wasm ?= /bin/true
+define MODULE_PREBUILD_wasm
+export RUST_VERSION=1.71.0 \\\n \
+\ \ \ \&\& export RUSTUP_HOME=/usr/src/unit/rustup \\\n \
+\ \ \ \&\& export CARGO_HOME=/usr/src/unit/cargo \\\n \
+\ \ \ \&\& export PATH=/usr/src/unit/cargo/bin:\$$PATH \\\n \
+\ \ \ \&\& dpkgArch="\$$\(dpkg --print-architecture\)" \\\n \
+\ \ \ \&\& case "\$${dpkgArch##*-}" in \\\n \
+\ \ \ \ \ \ amd64\) rustArch="x86_64-unknown-linux-gnu"; rustupSha256="0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db" ;; \\\n \
+\ \ \ \ \ \ arm64\) rustArch="aarch64-unknown-linux-gnu"; rustupSha256="673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800" ;; \\\n \
+\ \ \ \ \ \ *\) echo \>\&2 "unsupported architecture: \$${dpkgArch}"; exit 1 ;; \\\n \
+\ \ \ \esac \\\n \
+\ \ \ \&\& url="https://static.rust-lang.org/rustup/archive/1.26.0/\$${rustArch}/rustup-init" \\\n \
+\ \ \ \&\& curl -L -O "\$$url" \\\n \
+\ \ \ \&\& echo "\$${rustupSha256} *rustup-init" | sha256sum -c - \\\n \
+\ \ \ \&\& chmod +x rustup-init \\\n \
+\ \ \ \&\& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain \$$RUST_VERSION --default-host \$${rustArch} \\\n \
+\ \ \ \&\& rm rustup-init \\\n \
+\ \ \ \&\& rustup --version \\\n \
+\ \ \ \&\& cargo --version \\\n \
+\ \ \ \&\& rustc --version \\\n \
+\ \ \ \&\& make -C pkg/contrib .wasmtime \\\n \
+\ \ \ \&\& install -pm 755 pkg/contrib/wasmtime/target/release/libwasmtime.so /usr/lib/\$$\(dpkg-architecture -q DEB_HOST_MULTIARCH\)/
+endef
default:
@echo "valid targets: all build dockerfiles library clean"
-MODVERSIONS = $(foreach module, $(MODULES), $(foreach modversion, $(shell for v in $(VERSIONS_$(module)); do echo $$v; done | sort -r), $(module)$(modversion))) minimal
+MODVERSIONS = $(foreach module, $(MODULES), $(foreach modversion, $(shell for v in $(VERSIONS_$(module)); do echo $$v; done | sort -r), $(module)$(modversion))) wasm minimal
modname = $(shell echo $1 | /usr/bin/tr -d '.01234567890-')
@@ -86,6 +123,8 @@ Dockerfile.%: ../../version template.Dockerfile
-e 's,@@CONFIGURE@@,$(CONFIGURE_$(call modname, $*)),g' \
-e 's,@@INSTALL@@,$(INSTALL_$(call modname, $*)),g' \
-e 's,@@RUN@@,$(RUN_$(call modname, $*)),g' \
+ -e 's,@@MODULE_PREBUILD@@,$(MODULE_PREBUILD_$(call modname, $*)),g' \
+ -e 's,@@MODULE@@,$*,g' \
> $@
build-%: Dockerfile.%
@@ -103,10 +142,10 @@ library:
modname="$$( echo $$mod | tr -d '.0123456789-' )"; \
TAGS="$$mod $${mod%%.*} $$modname" ; \
TAGS="$$(echo $$TAGS | tr " " "\n" | sort -u -r | tr "\n" "," | sed "s/,/, /g")"; \
- if [ "$$previous" == "$$modname" ]; then \
+ if [ "$$previous" = "$$modname" ]; then \
echo "Tags: $(VERSION)-$$mod, $$mod"; \
else \
- if [ "$$mod" == "minimal" ]; then \
+ if [ "$$mod" = "minimal" ]; then \
echo "Tags: $(VERSION)-$$mod, $${TAGS%, }, latest"; \
else \
echo "Tags: $(VERSION)-$$mod, $${TAGS%, }"; \
@@ -120,6 +159,11 @@ library:
previous=$$(echo $$mod | tr -d '.0123456789-'); \
done
+diff: $(addprefix diff-, $(MODVERSIONS))
+
+diff-%:
+ @echo container-diff diff --type file daemon://$(CONTAINER_$*) daemon://unit:$(VERSION)-$*
+
all: $(addprefix Dockerfile., $(MODVERSIONS))
clean:
diff --git a/pkg/docker/template.Dockerfile b/pkg/docker/template.Dockerfile
index c6a72aa8..4d5cc101 100644
--- a/pkg/docker/template.Dockerfile
+++ b/pkg/docker/template.Dockerfile
@@ -1,6 +1,6 @@
FROM @@CONTAINER@@
-LABEL org.opencontainers.image.title="Unit"
+LABEL org.opencontainers.image.title="Unit (@@MODULE@@)"
LABEL org.opencontainers.image.description="Official build of Unit for Docker."
LABEL org.opencontainers.image.url="https://unit.nginx.org"
LABEL org.opencontainers.image.source="https://github.com/nginx/unit"
@@ -13,6 +13,8 @@ RUN set -ex \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates mercurial build-essential libssl-dev libpcre2-dev curl pkg-config \
&& mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \
+ && mkdir -p /usr/src/unit \
+ && cd /usr/src/unit \
&& hg clone -u @@VERSION@@-@@PATCHLEVEL@@ https://hg.nginx.org/unit \
&& cd unit \
&& NCPU="$(getconf _NPROCESSORS_ONLN)" \
@@ -22,7 +24,9 @@ RUN set -ex \
&& CONFIGURE_ARGS_MODULES="--prefix=/usr \
--statedir=/var/lib/unit \
--control=unix:/var/run/control.unit.sock \
+ --runstatedir=/var/run \
--pid=/var/run/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -41,6 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
+ && @@MODULE_PREBUILD@@ \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure @@CONFIGURE@@ \
&& make -j $NCPU @@INSTALL@@ \
@@ -49,7 +54,7 @@ RUN set -ex \
&& ./configure @@CONFIGURE@@ \
&& make -j $NCPU @@INSTALL@@ \
&& cd \
- && rm -rf unit \
+ && rm -rf /usr/src/unit \
&& for f in /usr/sbin/unitd /usr/lib/unit/modules/*.unit.so; do \
ldd $f | awk '/=>/{print $(NF-1)}' | while read n; do dpkg-query -S $n; done | sed 's/^\([^:]\+\):.*$/\1/' | sort | uniq >> /requirements.apt; \
done \
@@ -57,7 +62,7 @@ RUN set -ex \
&& { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; } \
&& @@RUN@@ \
&& mkdir -p /var/lib/unit/ \
- && mkdir /docker-entrypoint.d/ \
+ && mkdir -p /docker-entrypoint.d/ \
&& groupadd --gid 999 unit \
&& useradd \
--uid 999 \
@@ -69,7 +74,7 @@ RUN set -ex \
unit \
&& apt-get update \
&& apt-get --no-install-recommends --no-install-suggests -y install curl $(cat /requirements.apt) \
- && apt-get purge -y --auto-remove \
+ && apt-get purge -y --auto-remove build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /requirements.apt \
&& ln -sf /dev/stdout /var/log/unit.log
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index d3cc34bd..355f8a59 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -64,6 +64,7 @@ include Makefile.perl
include Makefile.jsc-common
include Makefile.jsc8
include Makefile.jsc11
+include Makefile.wasm
endif
ifeq ($(OSVER), centos9)
@@ -74,6 +75,7 @@ include Makefile.perl
include Makefile.jsc-common
include Makefile.jsc8
include Makefile.jsc11
+include Makefile.wasm
endif
ifeq ($(OSVER), amazonlinux2)
@@ -84,6 +86,7 @@ include Makefile.go
include Makefile.perl
include Makefile.jsc-common
include Makefile.jsc8
+include Makefile.wasm
endif
ifeq ($(OSVER), amazonlinux2023)
@@ -94,6 +97,7 @@ include Makefile.go
include Makefile.perl
include Makefile.jsc-common
include Makefile.jsc17
+include Makefile.wasm
endif
ifeq ($(OSVER), fedora)
@@ -105,6 +109,7 @@ include Makefile.ruby
include Makefile.jsc-common
include Makefile.jsc8
include Makefile.jsc11
+include Makefile.wasm
endif
ifeq ($(OSVER), fedora37)
@@ -116,13 +121,16 @@ include Makefile.ruby
include Makefile.jsc-common
include Makefile.jsc8
include Makefile.jsc11
+include Makefile.wasm
endif
CONFIGURE_ARGS_COMMON=\
--prefix=/usr \
--statedir=%{_sharedstatedir}/unit \
--control="unix:/var/run/unit/control.sock" \
+ --runstatedir=/var/run \
--pid=/var/run/unit/unit.pid \
+ --logdir=/var/log \
--log=/var/log/unit/unit.log \
--tmpdir=/var/tmp \
--user=unit \
@@ -216,6 +224,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil
done ; \
pkgname=$(shell echo $@ | cut -d '/' -f 3 | tr '_' '-' | cut -d '.' -f 1) ; \
definitions=`echo "$$MODULE_DEFINITIONS_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \
+ prebuild=`echo "$$MODULE_PREBUILD_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \
preinstall=`echo "$$MODULE_PREINSTALL_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \
postinstall=`echo "$$MODULE_POSTINSTALL_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \
files=`echo "$$MODULE_FILES_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \
@@ -234,6 +243,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil
-e "s#%%MODULE_MAKEARGS%%#$(MODULE_MAKEARGS_$*)#g" \
-e "s#%%MODULE_INSTARGS%%#$(MODULE_INSTARGS_$*)#g" \
-e "s#%%MODULE_DEFINITIONS%%#$${definitions}#g" \
+ -e "s#%%MODULE_PREBUILD%%#$${prebuild}#g" \
-e "s#%%MODULE_PREINSTALL%%#$${preinstall}#g" \
-e "s#%%MODULE_POSTINSTALL%%#$${postinstall}#g" \
-e "s#%%MODULE_FILES%%#$${files}#g" \
diff --git a/pkg/rpm/Makefile.wasm b/pkg/rpm/Makefile.wasm
new file mode 100644
index 00000000..c638071b
--- /dev/null
+++ b/pkg/rpm/Makefile.wasm
@@ -0,0 +1,51 @@
+MODULES+= wasm
+MODULE_SUFFIX_wasm= wasm
+
+MODULE_SUMMARY_wasm= WASM module for NGINX Unit
+
+MODULE_VERSION_wasm= $(VERSION)
+MODULE_RELEASE_wasm= 1
+
+MODULE_CONFARGS_wasm= wasm --include-path=\`pwd\`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=\`pwd\`/pkg/contrib/wasmtime/target/release
+MODULE_MAKEARGS_wasm= wasm
+MODULE_INSTARGS_wasm= wasm-install
+
+MODULE_SOURCES_wasm=
+
+BUILD_DEPENDS_wasm=
+
+BUILD_DEPENDS+= $(BUILD_DEPENDS_wasm)
+
+define MODULE_PREBUILD_wasm
+%{__make} -C pkg/contrib .wasmtime
+endef
+export MODULE_PREBUILD_wasm
+
+define MODULE_PREINSTALL_wasm
+endef
+export MODULE_PREINSTALL_wasm
+
+define MODULE_POSTINSTALL_wasm
+%{__install} -m 755 -p pkg/contrib/wasmtime/target/release/libwasmtime.so %{buildroot}%{_libdir}/
+endef
+export MODULE_POSTINSTALL_wasm
+
+define MODULE_FILES_wasm
+%{_libdir}/libwasmtime.so
+%{_libdir}/unit/modules/*
+%{_libdir}/unit/debug-modules/*
+endef
+export MODULE_FILES_wasm
+
+define MODULE_POST_wasm
+cat <<BANNER
+----------------------------------------------------------------------
+
+The $(MODULE_SUMMARY_wasm) has been installed.
+
+Online documentation is available at https://unit.nginx.org
+
+----------------------------------------------------------------------
+BANNER
+endef
+export MODULE_POST_wasm
diff --git a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11 b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11
index b08fcc34..4505b5b5 100644
--- a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11
+++ b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11
@@ -1,12 +1,15 @@
NGINX Unit.
- Copyright 2017-2022 NGINX, Inc.
+ Copyright 2017-2023 NGINX, Inc.
+ Copyright 2017-2023 Andrei Zeliankou
+ Copyright 2018-2023 Konstantin Pavlov
+ Copyright 2021-2023 Zhidao Hong
+ Copyright 2021-2023 Alejandro Colomar
+ Copyright 2022-2023 Andrew Clayton
+ Copyright 2022-2023 Liam Crilly
Copyright 2017-2022 Valentin V. Bartenev
Copyright 2017-2022 Max Romanov
- Copyright 2017-2022 Andrei Zeliankou
- Copyright 2018-2022 Konstantin Pavlov
- Copyright 2021-2022 Zhidao Hong
Copyright 2021-2022 Oisín Canty
Copyright 2017-2021 Igor Sysoev
Copyright 2017-2021 Andrei Belov
diff --git a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8 b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8
index 5e31863d..59891951 100644
--- a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8
+++ b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8
@@ -1,12 +1,15 @@
NGINX Unit.
- Copyright 2017-2022 NGINX, Inc.
+ Copyright 2017-2023 NGINX, Inc.
+ Copyright 2017-2023 Andrei Zeliankou
+ Copyright 2018-2023 Konstantin Pavlov
+ Copyright 2021-2023 Zhidao Hong
+ Copyright 2021-2023 Alejandro Colomar
+ Copyright 2022-2023 Andrew Clayton
+ Copyright 2022-2023 Liam Crilly
Copyright 2017-2022 Valentin V. Bartenev
Copyright 2017-2022 Max Romanov
- Copyright 2017-2022 Andrei Zeliankou
- Copyright 2018-2022 Konstantin Pavlov
- Copyright 2021-2022 Zhidao Hong
Copyright 2021-2022 Oisín Canty
Copyright 2017-2021 Igor Sysoev
Copyright 2017-2021 Andrei Belov
diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in
index 04323afc..b3d5d94b 100644
--- a/pkg/rpm/unit.module.spec.in
+++ b/pkg/rpm/unit.module.spec.in
@@ -59,6 +59,7 @@ This package contains %%SUMMARY%%.
tar --strip-components=1 -zxf %{SOURCE0}
%build
+%%MODULE_PREBUILD%%
./configure \
%{CONFIGURE_ARGS} \
--modulesdir=%{_libdir}/unit/debug-modules \
diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in
index 14a2ea00..01323650 100644
--- a/pkg/rpm/unit.spec.in
+++ b/pkg/rpm/unit.spec.in
@@ -47,6 +47,8 @@ Requires(postun): systemd
BuildRequires: pcre2-devel
BuildRequires: pkgconfig
+BuildRequires: clang
+BuildRequires: llvm
Provides: unit-r%{version}
@@ -99,6 +101,10 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
%{__make} %{?_smp_mflags}
%{__mv} build build-nodebug
+%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2})
+%{__make} %{?_smp_mflags} -C pkg/contrib .libunit-wasm
+%endif
+
%install
%{__rm} -rf %{buildroot}
%{__ln_s} build-nodebug build
@@ -136,6 +142,12 @@ DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install
%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unit.service
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/unit-debug.service
+%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2})
+%{__mkdir} -p %{buildroot}%{_includedir}/unit/
+%{__install} -m 644 pkg/contrib/libunit-wasm/src/c/libunit-wasm.a %{buildroot}%{_libdir}/
+%{__install} -m 644 pkg/contrib/libunit-wasm/src/c/include/unit/unit-wasm.h %{buildroot}%{_includedir}/unit/
+%endif
+
QA_SKIP_BUILD_ROOT=1
export QA_SKIP_BUILD_ROOT
@@ -221,6 +233,12 @@ BANNER
%files devel
%{_libdir}/libunit.a
%{_libdir}/libunit-debug.a
+%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2})
+%{_libdir}/libunit-wasm.a
+%dir %{_includedir}/unit
+%{_includedir}/unit/*.h
+%endif
%{_includedir}/nxt_*.h
+%{_datadir}/pkgconfig/unit.pc
%changelog