Change Ubuntu locale in Docker

三世轮回 提交于 2019-12-11 04:06:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!