Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: When installing nginx into an environment which focuses on a small footprint (like a container image), there are some dependencies that make the install quite large, while those deps might not be needed in the container environment: podman run -ti --rm fedora:34 [root@1be3ff423df3 /]# yum install nginx ... Total download size: 11 M Installed size: 35 M There is one solution that seems to make a difference and keeps the nginx package to work as previously -- to move the nginx daemon into a separate sub-package, that can be installed as a separate package. A draft is available as the PR (more showing the concept, might need some tweaks to make it production ready): https://src.fedoraproject.org/rpms/nginx/pull-request/13
I am generally in favour of this approach. One thing about nginx is that the understanding of "module" in nginx is slightly different from what I generally expect. Many "modules" end up needing to be statically built into the core binary as they are merely functionally modular, and not modular in a sense of an external dynamically loadable library. This leads to quite a few linked libraries within the core binary. The proposal is a very simple packaging fix which I appreciate, as it probably won't have a lot of side effects. What I am wondering: Is there value in offering a true nginx-minimal sub-package that contains a completely separate build that is truly minimal and only includes modules that require very minimal or common external libraries? That should be sufficient for most container use cases, which (I assume) mostly focus around proxying connections. I'll do some testing over the weekend to see what effect either of the options would have.
Hi Felix, did you do any testing over the weekend? If you don't have time, I can test it and review proposed packaging changes. From my point of view, this change as it is proposed makes sense, it will only "reorganize" installed files under different packages (subpackages).
So I created a scratch build[0] from the PR what Honza opened and so far it looks good. nginx is working as expected, systemd files are missing which is wanted and basic installation of nginx-core has fewer dependencies. [0] https://koji.fedoraproject.org/koji/taskinfo?taskID=84836394
Hi Luboš, yes, I tested this over the weekend. The PR as created by Honza works for me as well. I initially thought that we could trim down nginx even further by producing a second build that has less libraries linked to it. Turns out, the nginx binary as is already pretty much only has openssl and pcre (or pcre2 in the case of nginx-mainline) as external dependencies (alongside super basic stuff like glibc and zlib, obviously). So I'm happy to merge the PR as is. If we all agree I can go ahead and merge the PR and build the new package.
I would also add "Requires: openssl" to nginx-core. I didn't see that this depedency is missing it before, since openssl-libs are installed by default in minimal image (required by e.g. dnf or sudo).
OK so I merged this PR. I also added one change - nginx-core will require "openssl-libs" package. Maybe we should also think about removing "Requires: openssl" from the main nginx package, since nginx will now pull openssl-libs as recursive dependency of nginx-core package. Whole "openssl" package is IMHO not needed for nginx. What do you think Felix?
Commits: https://src.fedoraproject.org/rpms/nginx/c/bcc32b6d9595cfc20a1f20f7c00b4f0528b9fb31?branch=rawhide https://src.fedoraproject.org/rpms/nginx/c/ddc12361e126f8eceeeebcd605f2f1a449e4b7f9?branch=rawhide
Yes, openssl is not needed. Thanks!
Removed unnecessary openssl requires from main nginx package. Commit https://src.fedoraproject.org/rpms/nginx/c/f8f18d5dc4410f4c6e385da9bee3fd4635b20e75?branch=rawhide Everything should be in RAWHIDE now.