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

Docs: Why is Debian Recommended for Docker? #940

Open
MarkusJLechner opened this issue Jul 26, 2024 · 6 comments
Open

Docs: Why is Debian Recommended for Docker? #940

MarkusJLechner opened this issue Jul 26, 2024 · 6 comments

Comments

@MarkusJLechner
Copy link

https://frankenphp.dev/docs/docker/

FrankenPHP Docker images are based on official PHP images. Debian and Alpine Linux variants are provided for popular architectures. Debian variants are recommended.

The headline states that Debian is recommended. Documentation should provide clarification rather than just statements; therefore, an explanation or reference supporting this recommendation should be included.

@nickchomey
Copy link

That is a bit strange - as far as I'm aware, alpine is by far the most common in docker images. It would indeed be useful to know why debian is recommended instead.

@withinboredom
Copy link
Collaborator

My 2¢ and why I don't recommend musl/alpine in production:

Multiple reasons, mostly due to musl implementation details breaking something in Go/PHP. Also, fwiw, the 'official php' images are managed by the community and aren't maintained by php, nor does PHP have any unit tests running on alpine (https://github.com/php/php-src/actions/runs/10094146717 for example).

Secondly, if you search the PHP issues, musl bugs are fixed rather quickly, but only once they are reported. There isn't any proactive hunting for those bugs.

And finally, many libraries (like openssl, for example) have to disable a bunch of failing tests for musl.

OH, and I almost forgot to mention the DNS shenanigans that happen on alpine php... if you haven't run into the "internet disappearing bug" yet, it's super confusing and was the straw that broke our back at work; when we moved to debian-only.

Personally, I wouldn't recommend it for production systems, just to shave a few dozen megabytes off an image size. If you absolutely need those megabytes, then go for it.

@withinboredom
Copy link
Collaborator

It's also worth noting that this probably won't always be the case. Rereading that it sounds like doom-and-gloom, but it isn't that bad. It works most of the time, but when it doesn't work, it can be very frustrating.

@sneycampos
Copy link
Contributor

@MarkusJLechner
Copy link
Author

Thanks @sneycampos for the link. For those who don't have access to X, I'll post the comments here:

  • Q: Is that FrankenPHP related, or do you recommend the Debian images for PHP even without FrankenPHP?
    A: I recommend Debian with and without FrankenPHP! - @dunglas

  • Q: Do you have any performance numbers for using glibc?
    A: No, but musl can prevent enabling the JIT: Moving to Debian symfony-docker#555 - @dunglas

  • Interesting. I also had issues with iconv on the Alpine distribution.

The mentioned issue dunglas/symfony-docker#555 mostly explains why the documentation recommends Debian. The performance issue discussed on Stack Overflow may also be relevant to some users.
@withinboredom's comment is also valuable.

Updating the docs or mentioning this issue could help others who encounter the same question why Debian is preferred. Since it's clear to me, I wouldn't mind closing this issue.

@dunglas
Copy link
Owner

dunglas commented Jul 30, 2024

A docs PR would be very welcome!

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

5 participants