Open MarkusJLechner opened 3 months ago
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.
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.
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.
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: https://github.com/dunglas/symfony-docker/issues/555 - @dunglas
Interesting. I also had issues with iconv on the Alpine distribution.
The mentioned issue https://github.com/dunglas/symfony-docker/issues/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.
A docs PR would be very welcome!
https://frankenphp.dev/docs/docker/
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.