-
Notifications
You must be signed in to change notification settings - Fork 137
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
Feature Request: Install locales through environment variables #212
Comments
+1. I solved it for now by adding to my Dockerfile:
|
That supposedly installs all locales, even not necessary ones. We currently use this: USER root
ARG LOCALES="de_DE.UTF-8"
RUN for l in ${LOCALES}; \
do sed -i -e "s/# \(${l} .*\)/\1/" /etc/locale.gen; \
done
RUN dpkg-reconfigure -f noninteractive locales
USER docker Still it would be nice if this or something similar was available by default without a custom build. |
Cool, that is indeed less drastic :) Thanks, will switch to that.
|
Not sure what "doesnt' seem to work" mean exactly. We're using this for ages and various image versions just fine:
|
0.116 sed: can't read /etc/locale.gen: No such file or directory |
Ah you are right, we obviously install the USER root
RUN apt-get update \
&& apt-get install -y \
... \
locales \
... \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG LOCALES="de_DE.UTF-8"
RUN for l in ${LOCALES}; \
do sed -i -e "s/# \(${l} .*\)/\1/" /etc/locale.gen; \
done
RUN dpkg-reconfigure -f noninteractive locales
USER docker |
Expected Behavior
Some stuff in PHP depends heavily on locales, so I'd expect locales to be supported by a general-purpose PHP container.
Current Behavior
I need to create a custom Dockerfile to install and install the neccessary locales:
Possible Solution
Add an environment variable
LOCALES="en_GB.UTF-8 de_DE.UTF-8"
that generates the locales on container start. Setting PHP_INI_INTL__DEFAULT_LOCALE can be an independent option.Context
I want to use ProcessWire, and am trying to create as few custom Docker images as possible.
Your Environment
The text was updated successfully, but these errors were encountered: