歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Docker下CentOS中文亂碼問題處理

Docker下CentOS中文亂碼問題處理

日期:2017/2/28 13:44:01   编辑:Linux教程

使用Docker pull CentOS,完了之後鏡像無法顯示中文問題。

FROM centos
MAINTAINER 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 #設置環境變量
RUN yum -y install python-setuptools && easy_install pip && pip install supervisor #安裝supervisor多進程管理工具,用於啟動多進程

可將以上文件作為dockerfile的初始部分

如果是實體機的話執行以下命令即可
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

以上就可以解決Zabbix
You are not able to choose some of the languages, because locales for them are not installed on the web server.

Copyright © Linux教程網 All Rights Reserved