Docker 拉取 中文乱码及libreoffice安装

把缺省的docker镜像仓库换成国内的网易镜像

echo "DOCKER_OPTS=\"\$DOCKER_OPTS –registry-mirror=http://hub-mirror.c.163.com\"" >> /etc/default/docker


service docker restart

下载centos docker镜像

docker pull centos

启动centos的docker镜像并进入

docker run -it centos /bin/bash

安装libreoffice、中文字体库等所需的软件

yum install libreoffice-writer.x86_64

yum groupinstall "Fonts"

yum groupinstall "Input Methods"

rm -rf /etc/localtime 
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum -y install kde-l10n-Chinese
yum -y reinstall glibc-common && localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
yum clean all

修改/root/.bashrc文件添加source /etc/profile

vi /root/.bashrc 
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
source /etc/profile  #添加这个就行了

还是不行加这个

localedef -c -f UTF-8 -i zh_CN zh_CN.utf8  

测试是否转换pdf成功

libreoffice --invisible --convert-to pdf --outdir /opt/testdata/ c39fd14fb02944d3aba22a4e408b000b.doc 

你可能感兴趣的:(Docker 拉取 中文乱码及libreoffice安装)