Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upstream NGINX image #23

Closed
wants to merge 3 commits into from

Conversation

TommyTran732
Copy link

@TommyTran732 TommyTran732 commented Sep 6, 2022

The current images are 2 years out of date, and if it's too much work to track the releases I'd suggest just using the upstream image. Using alpine as the base OS will also help reduce the attack surface as well.

This PR includes the changes in my previous PR #22.

@olof-nord
Copy link

Yes, I came here wanting to mention this too. Speaking of attack surfaces: there are two flavours of nginx docker images published by nginxinc themselves, with or without root. The ones which runs without root could also be a possibility: nginxinc/nginx-unprivileged. With the unprivileged image, the default port is 8080.

@jtheo
Copy link

jtheo commented Sep 28, 2022

I run some Nginx as proxies, and I have them running with the filesystem in read-only and the config in tmpfs, in this case, since they're a shared volume, wouldn't be better to have them in :ro instead of :Z?
I mean the one for nginx-terminate.

@abscondment
Copy link

I think this project needs to user the Dockerfile build methods and can't just switch to nginx:alpine. ngx_stream_ssl_module / ngx_stream_ssl_preread_module aren't built by default, but are used by both images.

So #28 looks like the correct path for updating the nginx version.

@jtheo
Copy link

jtheo commented Oct 12, 2022

@abscondment, sorry, not sure to understand:

I think this project needs to user the Dockerfile build methods and can't just switch to nginx:alpine. ngx_stream_ssl_module / ngx_stream_ssl_preread_module aren't built by default, but are used by both images.

The modules are already present in the alpine image:

$ docker run -it nginx:alpine nginx -V | tr ' ' '\n' | grep ssl
--with-http_ssl_module
--with-mail_ssl_module
--with-stream_ssl_module
--with-stream_ssl_preread_module

@olof-nord
Copy link

@abscondment, sorry, not sure to understand:

I think this project needs to user the Dockerfile build methods and can't just switch to nginx:alpine. ngx_stream_ssl_module / ngx_stream_ssl_preread_module aren't built by default, but are used by both images.

The modules are already present in the alpine image:

$ docker run -it nginx:alpine nginx -V | tr ' ' '\n' | grep ssl
--with-http_ssl_module
--with-mail_ssl_module
--with-stream_ssl_module
--with-stream_ssl_preread_module

With that excellent one-liner, I can also confirm that also the rootless image contains the required modules:

$ docker run -it nginxinc/nginx-unprivileged nginx -V | tr ' ' '\n' | grep ssl
--with-http_ssl_module
--with-mail_ssl_module
--with-stream_ssl_module
--with-stream_ssl_preread_module

@abscondment
Copy link

Cool! TIL how alpine builds nginx :)

@TommyTran732
Copy link
Author

TommyTran732 commented Oct 15, 2022

Yes, I came here wanting to mention this too. Speaking of attack surfaces: there are two flavours of nginx docker images published by nginxinc themselves, with or without root. The ones which runs without root could also be a possibility: nginxinc/nginx-unprivileged. With the unprivileged image, the default port is 8080.

Do you have a working config for the rootless container?

I have the root container working with privileges dropped and what not, but I couldn't get the rootless one working. I could try again though when I have time, though it would be nice if someone has a working config ready.

@benbucksch
Copy link

I was about to file a bug to do exactly what this PR does. The current state of having the nginx versions hardcoded in the source code is difficult to maintain and leads to security bugs. Using nginx:latest or nginx:alpine as this PR does is the obvious solution.

+1 to merge this.

Signed-off-by: Tommy <[email protected]>
@ravi-signal
Copy link
Contributor

Thanks for the work and discussion here! We moved over to the latest nginx-alpine image in #45

@ravi-signal ravi-signal closed this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants