docker-openresty icon indicating copy to clipboard operation
docker-openresty copied to clipboard

Adding Third Party Modules to Debian Images Utilizing the ".deb" Installation

Open michohl opened this issue 1 year ago • 1 comments

I'm attempting to transition our openresty images from Alpine to Debian currently. However, we have a single module, NAXSI, that we load into our image which we were historically adding as part of the compile step as a dynamic module.

The new debian images are no longer doing the compile in the Dockerfile but are instead expecting the user to use opm to install additional modules. However, the module I'm attempting to install does not have an opm package of their module: https://github.com/wargio/naxsi/issues/114

In other versions of the Dockerfile it seems that this could be done through something like REST_CONFIG_OPTIONS_MORE https://github.com/openresty/docker-openresty/blob/30682c9b6066ed30740b5e6f9a555549e873529b/jammy/Dockerfile#L54

which is no longer available in the Debian images as far as I can tell.

What would be the best way to go about building a Docker image that has a third party package installed without utilizing opm?

michohl avatar Jan 24 '24 19:01 michohl

Really sorry I took so long to reply to you on this. With respect to Debian, we have not had "built-from-source" flavors for a long time (if ever?). Instead that has been focused on Ubuntu. The Debian flavors are "built-from-upstream", so there is no compilation. These built-from-source are the ones that you must use to build custom dynamic modules.

I am not sure if the "deb" package would work here. Even if you built the Naxsi Debian source package for Ubuntu, because the OpenResty vs default Nginx paths are different? It would have to be installed from source, rather than Debian package (during the image build).

We only support Ubuntu vs Debian for build-from-source simply because there's way too many to have both for and Ubuntu moves faster than Debian (e.g. we have OpenResty Noble images before upstream OpenResty does).

So, you might be able to install that Naxos module from source using the Ubuntu flavor build argument variables (like RESTY_CONFIG_OPTIONS_MORE, etc).

neomantra avatar Oct 23 '24 13:10 neomantra