I've noticed issues on getting custom locale work.
Here is below an attempt to reproduce example from http://php.net/manual/en/function.setlocale.php
php > setlocale(LC_ALL, 'nl_NL');
php > echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
Friday 22 December 1978
php > var_dump(setlocale(LC_ALL, 'nl_NL'));
string(5) "nl_NL"
I've read alpine warning. So, if this issue cannot be solved, it makes sense to add some warning to mentioned paragraph.
Looks like this is a duplicate of https://github.com/docker-library/php/issues/219 -- if musl doesn't support locales (and PHP relies on libc to provide locale support), there's really not much of anything we can do here.
As I suggested, let's update the documentation to notice this as one of the most significant drawback. Just create a list of known issues using alpine would be enough. What do you think @tianon ?
In theory that sounds good, but in practice I think that's going to be a fairly long errata list that's difficult to keep up-to-date (which is why the existing Alpine documentation specifically includes catch-all phrasing about Alpine not necessarily acting in the same way; standard "buyer beware" phrasing). :confused:
But it will save a lot of time for developers, since not everybody knows a difference. How that was for me — 1) I've tried to find and reproduce suitable example of locale working, 2) tried to google solution how to install/generate locales on alpine, 3) finally found some messages that musl doesn't support locales. May be I'm a really dumb developer and devops but without any official warnings I tried to find a solution and thought it's my fault, not such huge drawback of alpine. I just could not image it's known issue.
I can see where you're coming from, but it is a _big_ ask for us to maintain such a list. We already link to http://www.etalabs.net/compare_libcs.html, which is a fairly comprehensive comparison of several libc variants (see especially the "POSIX localedef" line, where glibc is the _only_ libc that actually implements it).
Not only would this be a large amount of labor to build and maintain, but we're also not entirely comfortable with our knowledge of the low-level details to feel comfortable putting out such an authoritative list.
For what it's worth, Googling for "php alpine locales", the first result is https://github.com/gliderlabs/docker-alpine/issues/144, the second result is https://github.com/docker-library/php/issues/219, and the third result is this very discussion, so I think we're already at a pretty decent level of discoverability.
Most helpful comment
But it will save a lot of time for developers, since not everybody knows a difference. How that was for me — 1) I've tried to find and reproduce suitable example of locale working, 2) tried to google solution how to install/generate locales on alpine, 3) finally found some messages that musl doesn't support locales. May be I'm a really dumb developer and devops but without any official warnings I tried to find a solution and thought it's my fault, not such huge drawback of alpine. I just could not image it's known issue.