Docker-nginx: Nginx "extras"?

Created on 26 Jan 2015  Â·  25Comments  Â·  Source: nginxinc/docker-nginx

I seem to not be able to find any information about this on the internet and that nginx-extras seems to be a debian/ubuntu only package. But I would like to know if there is somewhere, it is possible to get a docker image of nginx, with all modules included or will we simply have to start maintaining our own docker image inhouse?

Most helpful comment

How do I install headers-more-nginx-module module to official nginx repo?

All 25 comments

Sorry, there are no plans currently to provide official nginx images with third-party modules. If you really need those third-party modules, the only option so far is to maintain your own docker image.

I'm not actually talking 3rd party modules, I am talking the optional nginx modules listed here: http://wiki.nginx.org/Modules

Which modules exactly?

The modules listed here: http://wiki.nginx.org/Modules#Optional_HTTP_modules
Like webdav, embedded perl and gzip compression.

http_dav, http_gzip_static and http_gunzip are enabled in the builds provided within official image.

The current idea in packaging official nginx is to enable as many optional modules as long they do not require anything external, like language interpreter or a shared library.

I'll leave this issue open. We will consider providing builds with that functionality if there is a huge demand for it. (There was none yet).

Is there an actual list of what is enabled and what is not, in the current docker image?
Because if we are only missing embedded perl/lua, then it might possibly be easy to work around this.

As an example this is what is enabled/disabled on the different types for debian/ubuntu: https://wiki.debian.org/Nginx
Disregarding the NAXSI version, those three version make a lot of sense, but I of course am also well aware that this means a lot of possibly unnecessary work.

There is no such matrix table to look into - the fastest way would be to check "docker run -t nginx:latest nginx -V".

Just a bit of clarification: nginx in the official docker image is not package we build only for docker, it's the one we build for a variety of operating systems, see http://nginx.org/en/linux_packages.html. Indeed it will mean a substantial amount of work to keep those in sync and updated.

Thank you, that seems to clarify things a bit more.

Following up on this, the ngx_http_gzip_module does not seam to be enabled right? To use gzip should I roll my own docker image instead?

@thenikso this module is always enabled. You can use this docker image if you need it.

@thenikso, that was my conclusion too.

But when you do:

$ docker run nginx nginx -V
nginx version: nginx/1.9.0
built by gcc 4.9.2 (Debian 4.9.2-10)
built with OpenSSL 1.0.1k 8 Jan 2015
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_spdy_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,--as-needed' --with-ipv6

Gzip is here. But I don't know why I can't make it work...

Problem found. GZIP only works for HTTP 1.1 by default.
Added gzip_http_version 1.0; to nginx.conf made it work as expected.

Inspiration could be Apache httpd project. It includes utility a2enmod what could be used to enable module in dockerfile with FROM nginx, so we can use official Docker image even if we need some extra module.

nginx -V shows perl absent, which I need for a simple header rewrite. It seems like the thing to do would normally be to install nginx-extras, but apt-get remove -y nginx && apt-get install -y nginx-extras fails with rm: cannot remove '/var/cache/nginx': Device or resource busy.

Is my best option at this point to maintain my own fork?

Ok, I'm finding myself deep in git://anonscm.debian.org/collab-maint/nginx.git to try to build the extras I need myself on top of an already-installed nginx... this is looking dramatically more complex that it needs to be... what am I missing?

Propose reopening this #14

Why not to create Docker Hub tag e.g. extras what will be the same, but
it will install nginx-extras instead of nginx package?

Jan Pobořil

2016-01-11 20:46 GMT+01:00 Dave Thomas [email protected]:

Ok, I'm finding myself deep in git://
anonscm.debian.org/collab-maint/nginx.git to try to build the extras I
need myself on top of an already-installed nginx... this is looking
dramatically more complex that it needs to be... what am I missing?

Propose reopening this #14
https://github.com/nginxinc/docker-nginx/issues/14

—
Reply to this email directly or view it on GitHub
https://github.com/nginxinc/docker-nginx/issues/14#issuecomment-170668165
.

How do I install headers-more-nginx-module module to official nginx repo?

how to add the redis module in docker image ?

https://www.nginx.com/resources/wiki/modules/redis/

FWIW, running apt-get update before trying to install worked for me:

FROM nginx:1.13.12
RUN apt-get update
RUN apt-get install -y nginx-extras
...

And I had to load my module in the nginx.conf in the 'global' section:

load_module "modules/ngx_http_image_filter_module.so";

Is there a docker image including the fancy-indexing module? And if not, should I go the

RUN apt-get update
RUN apt-get install -y nginx-extras

route or has this been changed from last year?

Unfortunately, running

RUN apt-get install -y nginx-extras

will uninstall whatever version of nginx your docker image installed originally and install nginx 1.10.3 instead.

@sromocki; I decided to use the debian testing release (for nginx only), which has been stable quite long now. I even use it on stretch in production level environments. But not in a docker instance.

Want! I need Lua!

So, how can we use Headers More?

For the record, this page gives instructions for installing third-party modules with this image. I don't understand it, but perhaps you will.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsdevel picture jsdevel  Â·  5Comments

luckymark picture luckymark  Â·  4Comments

hasancansaral picture hasancansaral  Â·  6Comments

a-shink picture a-shink  Â·  3Comments

rokf picture rokf  Â·  5Comments