Skip to content
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

Docker容器—CentOS中文乱码/时区混乱问题 #70

Open
johnnian opened this issue Jan 28, 2020 · 0 comments
Open

Docker容器—CentOS中文乱码/时区混乱问题 #70

johnnian opened this issue Jan 28, 2020 · 0 comments
Labels

Comments

@johnnian
Copy link
Owner

方案1:DockerFile

FROM centos
MAINTAINER http://fengwan.blog.51cto.com
RUN rm -rf /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  #修改时区 
RUN yum -y install kde-l10n-Chinese && yum -y reinstall glibc-common  #安装中文支持 
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8  #配置显示中文 
ENV LC_ALL zh_CN.utf8  #设置环境变量 

方案2: 手动修改

进入Docker容器的命令行,执行下面操作:

yum -y install kde-l10n-Chinese && yum -y reinstall glibc-common
localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
export LC_ALL=zh_CN.utf8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant