Skip to content

vvrein/static-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

This is the project that builds statically linked nginx binary

Project's aim is to make portable nginx binary, compiled with some custom modules, and as much as it might be, standard modules that is not built by default, which can be spread accross different machices and OS'es with no need to compile statically or dynamically on every machine. Yup, in general - static linking is bad, nevertheless it allows you run same binary on you machinery zoo.
Another use case - use it in your FROM scratch docker container, although size of single nginx binary is ~3x times larger than alpine image with nginx installed (default install, no additional modules).

It also incorporates modules:

Usage:

docker build . -t nginx:nginx
docker create --name nginx nginx:nginx
docker cp nginx:/tmp/src/nginx/objs/nginx nginx

To run tests:

docker run --rm -it nginx:nginx nginx sh
cd /tmp/src/nginx-tests; sudo -u nobody env PATH=/tmp/src/openssl/apps/:$PATH TEST_NGINX_BINARY=/tmp/src/nginx/objs/nginx prove .
cd /tmp/src/nginx-vts; PATH=/tmp/src/nginx/objs/:$PATH prove -r $(ls -1 t/ | grep '[[:digit:]]' | grep -v lua | sed 's/^/t\//')

Some links than are nice to mention here:

About nginx-tests:
nginx/nginx-tests#17

nginx-tests, as primarily a developer test suite, is used to run against nginx mainline and the latest stable branch.
Once a new stable branch is created, support for the previous one that becomes legacy is removed.
Occasionally, support for the previous stable branch may be extended, for practical reasons.

About available modules exctraction:

grep -hoPR -- '--with-[^\s=\)"\\]+' auto/ | grep -vP -- '-asm|-opt|-cc|-cpp|perftools_module|degradation_module|md5|sha1|imap|ipv6'  | sort | uniq
curl -qs  https://nginx.org/en/docs/configure.html | grep -oP -- '--with-[^<>=\s]+'  | sort | uniq | grep -vP -- '-cc|-cpp|-cpu|-opt|test_module|perftools_module|geoip_module'

About

Statically linked nginx

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published