-
Notifications
You must be signed in to change notification settings - Fork 16
3. Builds
Shared libraries with a .so
extension are produced for each Linux distro, in your local ./build
folder:
alpine.ngx_curity_http_phantom_token_module_1.27.4.so
debian.bookworm.ngx_curity_http_phantom_token_module_1.27.4.so
ubuntu.24.04.ngx_curity_http_phantom_token_module_1.27.4.so
Build the code into a dynamic module for a single platform like this:
export NGINX_VERSION='1.27.4'
export LINUX_DISTRO='alpine'
./build.sh
Produce all pre-built releases with the following script:
./buildall.sh
To build for older releases it is possible that you need to use older versions of dependency libraries like PCRE and ZLIB. For example, to build version 1.19.5 you can use the following approach:
- Find a release like 1.3.0 that includes the old NGINX version.
- View the 1.3.0 Docker Build Resource which uses
pcre-dev
. - Update the Latest Docker Build Resource to use
pcre-dev
instead ofpcre2-dev
.
When the ./configure
script is called, the main NGINX system's ./configure
script is invoked.
This can accept custom parameters from this nginx page including these:
Option | Description |
---|---|
--with-cc-opt | Settings to add to the CFLAGS variable used by the linker |
--with-ld-opt | Settings to add to LDFLAGS variable used by the linker |
The NGINX configure script uses automake
to produce the build file at ./nginx-1.27.4/objs/Makefile
.
Some CFLAGS settings, such as -std=c99
, are dictated by the nginx system.
A multi-stage Docker build is used, to output built .so
files to an nginx-module-builder
image.
To troubleshoot failures, remote to the most recent Docker image in docker image list
.
Build commands can then be run manually if required, to understand the failure cause:
docker run -it a77962ad4c52
cd /tmp
make