1, the official centos default image does not support Chinese, for example, touch a file that contains Chinese name, the file name will appear DOC ???.
2, LibreOffice installation and testing
my Dockerfile document reads as follows:
CentOS the FROM # mirror source used here is CentOS MAINTAINER " [email protected] " # safeguard personal information, may be deleted RUN yum install LibreOffice -writer.x86_64 - the y-\ && yum groupinstall " Fonts " - the y-\ && yum groupinstall " the Input Methods " -y \ # above three instructions to install libreoffice program and font support && RM -rf / etc / localtime \ && LN -s / usr / report this content share / zoneinfo / Asia / on Shanghai / etc / localtime \ &&yum -y install kde-l10n-Chinese \ REINSTALL glibc-yum -y && && the localedef the Common -c -f UTF-8 -i zh_CN zh_CN.utf8 \ # this is to add a few Chinese support && yum Clean All # final cleanup yum cache ENV LC_ALL zh_CN.utf8 # Set Chinese support surroundings
Create a new blank folder name at random, will Dockerfile moved here, and then do
- docker build -t libreoffice:01 .
Awaiting execution is complete, view the image you currently have, execution
- docker images
result
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
libreoffice 01 caaa911e050a 16 minutes ago 1.122 GB
After the test data volume is first mounted into the container
- docker run -it -v ~/file_dir/:/data libreoffice:01 bash
Here file_dir is to convert the directory files, then convert
- soffice --headless --convert-to txt 测试.doc
Conversion complete file named test .txt, then you can view the contents of cat