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

Remove nginx-debug from alpine-slim images #943

Open
ferferga opened this issue Nov 20, 2024 · 1 comment
Open

Remove nginx-debug from alpine-slim images #943

ferferga opened this issue Nov 20, 2024 · 1 comment

Comments

@ferferga
Copy link

Describe the solution you'd like

The alpine-slim images ship with a debug version of nginx at /usr/sbin/nginx-debug. This binary, intended just for debugging purposes, should not be included in the image since it increases the size unnecessarily, while the goal for slim images is to provide the bare minimum to have nginx working (and debugging it's not the bare minimum).

Shipping nginx-debug its like shipping an application to production with debugging symbols, which is definitely a bad practice.

Describe alternatives you've considered

I'm currently building my own version of this container and I remove that binary, but I believe this specifically is something that should come out of the box for everyone.

Additional context

If a user requires debugging for some special circumstance, a simple switch to the equivalent non slim tag would be enough.

@thresheek
Copy link
Collaborator

Hello @ferferga!

First, it's not debugging symbols we ship with nginx-debug, but rather a binary that has debugging log enabled - so comparison isnt exactly correct.

Secondly, removing this binary we're winning around 1.5 megabytes out of 20 megabytes:

$ docker images | grep -i alpine-slim
nginx                                         alpine-slimmer           c53b5885078d   2 minutes ago   17.6MB
nginx                                         alpine-slim              7c464d66ccc9   7 weeks ago     19.1MB

(slimmer is just rm -f /usr/sbin/nginx-debug). While I agree we're going to save some space by trimming it, having a slim image was never about the size - see discussions in #681 for instance.

Third, we use slim images as a base for non-slim ones, and removing the binary means we'd need to re-introduce package reinstall on those leaf images, which is a bit of an extra effort.

With that said, I don't think it's worth removing the binary just to save some space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants