问题
So I'm setting up a docker image with Ubuntu and Postgresql in pt_BR and I'd like to know how can I change the default locale via command line without restarting the system - which is not possible in a Docker build :).
I managed to do it in Debian by changing setting LANG,LANGUAGE and LC_* variables in /etc/default/locale
, modifying /etc/locale.gen
and running dpkg-reconfigure
, as shown here. In Ubuntu it doesn't work.
回答1:
It should work with Ubuntu similarly.
A sample Dockerfile
FROM ubuntu
RUN apt-get install -y language-pack-pt-base
ENV LANG pt_BR.UTF-8
Running a container from that image, ls --help
will be presented in Portuguese.
来源:https://stackoverflow.com/questions/26473819/change-ubuntu-locale-in-docker