如何设置Docker容器内的区域? [英] How to set the locale inside a Docker container?
问题描述
我的终端字符编码设置为UTF-8,我使用SSH连接到我的容器。但是,我无法输入挪威字符,也不能复制和粘贴挪威字符,也不能使用CTL + SHIFT + U + 00f8。
我试过:
locale-gen nb_NO.UTF-8
,但没有改变。如何将区域设置和键盘设置在Docker容器内?
将Dockerfile中的东西从
#设置语言环境
RUN sed -i -e's /#en_US.UTF-8 UTF-8 / en_US.UTF- 8 UTF-8 /'/etc/locale.gen&& \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
这是从这个主题的非常好的帖子中提取的,从
http://jaredmarkell.com/docker-and-locales/
I'm running a Ubuntu Docker container. I have a Norwegian keyboard and need to use Norwegian characters (øæå).
My Terminal character encoding is set to UTF-8 and I'm connected to my container using SSH. However, I'm unable to type Norwegian characters, nor copy and paste Norwegian characters, nor use CTL+SHIFT+U+00f8.
I tried:
locale-gen nb_NO.UTF-8
but nothing changed. How do I set the locale and keyboard inside a Docker container?
Put in your Dockerfile something adapted from
# Set the locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
this is extracted from the very good post on that subject, from
http://jaredmarkell.com/docker-and-locales/
这篇关于如何设置Docker容器内的区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!