-
-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Labels
❇️ Variation: UnitIssues affecting NGINX UnitIssues affecting NGINX Unit🙏 Help WantedIssues that specifically could use some help from the communityIssues that specifically could use some help from the community🥶 Bug: Upstream DependencyBugs that affect this project, but need to be fixed in an upsteam library.Bugs that affect this project, but need to be fixed in an upsteam library.
Description
Affected Docker Images
- *-unit-alpine
Current Behavior
When attempting to build an Alpine version of Unit, the build fails with this error:
23.87 creating build/Makefile
24.03
24.03 Unit configuration summary:
24.03
24.03 bin directory: ............. "/usr/bin"
24.03 sbin directory: ............ "/usr/sbin"
24.03 lib directory: ............. "/usr/lib"
24.03 include directory: ......... "/usr/include"
24.03 pkgconfig directory: ....... "/usr/share/pkgconfig"
24.03 man pages directory: ....... "/usr/share/man"
24.03 modules directory: ......... "/usr/lib/unit/debug-modules"
24.03 state directory: ........... "/var/lib/unit"
24.03 tmp directory: ............. "/var/tmp"
24.03
24.03 pid file: .................. "/var/run/unit.pid"
24.03 log file: .................. "/dev/stdout"
24.03
24.03 control API socket: ........ "unix:/var/run/control.unit.sock"
24.03
24.03 non-privileged user: ....... "www-data"
24.03 non-privileged group: ...... "www-data"
24.03
24.03 IPv6 support: .............. YES
24.03 Unix domain sockets support: YES
24.03 TLS support: ............... YES
24.03 Regex support: ............. YES
24.03 NJS support: ............... NO
24.03
24.03 process isolation: ......... USER NS PID NET UTS CGROUP
24.03 cgroupv2: .................. YES
24.03
24.03 debug logging: ............. YES
24.03
24.03 + ./configure php
24.03 configuring PHP module
24.03 checking for PHP ... found
24.04 + PHP SAPI: [cli phpdbg cgi]
24.04 checking for PHP version ... not found
24.12 checking for PHP embed SAPI ... not found
24.19
24.19 ./configure: error: no PHP embed SAPI found.
Reason why this is failing
PHP excluded embed for the Alpine versions
Expected Behavior
Unit should be able to compile and deliver an Alpine version.
Steps To Reproduce
Attempt to build an Alpine version locally:
bash scripts/dev.sh --variation unit --version 8.2.12 --os alpine
👉 Next Steps & Proposed Solution
Notes on how development works
https://serversideup.net/open-source/docker-php/docs/getting-started/contributing
Add Embed support
- Convert the base image to use ZTS for
embedsupport (Enable embed also on alpine cli docker-library/php#1355 (comment))
Example: 358f225
Update installer to support Debian and Alpine
docker-php/src/variations/unit/Dockerfile
Lines 21 to 60 in aa4ad44
| mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules && \ | |
| cd /usr/src/ && \ | |
| hg clone -u ${NGINX_UNIT_VERSION} 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=/dev/stdout \ | |
| --tmpdir=/var/tmp \ | |
| --user=www-data \ | |
| --group=www-data \ | |
| --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 php && \ | |
| make -j $NCPU php-install && \ | |
| make clean && \ | |
| ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules && \ | |
| ./configure php && \ | |
| make -j $NCPU php-install && \ | |
| mkdir -p /var/lib/unit/ |
- Break the scripts into two separate files
- Load the script based on the OS installing
Features to support
- Compile NGINX Unit from source with the provided PHP version from the base image
- Enable the copying of
unitdfor "production use" - Enable the copying of
unitd-debugfor debug use
Important notes on current functionality
- We will continue to use the "Docker CMD Override" currently in place
Validating functionality
- Ensure 8.3.12 works with bookworm
bash scripts/dev.sh --variation unit --version 8.3.13 --os bookworm
- Ensure 8.3.12 works with alpine
bash scripts/dev.sh --variation unit --version 8.3.13 --os alpine
- Ensure 7.4.33 works with bullseye
bash scripts/dev.sh --variation unit --version 7.4.33 --os bullseye
- Ensure 7.4.33 works with alpine
bash scripts/dev.sh --variation unit --version 7.4.33 --os alpine
keenthekeenbeeyev and jsayer101
Metadata
Metadata
Assignees
Labels
❇️ Variation: UnitIssues affecting NGINX UnitIssues affecting NGINX Unit🙏 Help WantedIssues that specifically could use some help from the communityIssues that specifically could use some help from the community🥶 Bug: Upstream DependencyBugs that affect this project, but need to be fixed in an upsteam library.Bugs that affect this project, but need to be fixed in an upsteam library.