1、下载需要的rpm包和从windows下找到需要的中文字体
1.1在http://rpmfind.net/linux/rpm2html/search.php?query=fontconfig(x86-64)地址下载需要的rpm包,分别为一下包:
fontconfig-2.13.0-4.3.el7.x86_64.rpm
freetype-2.8-14.el7.x86_64.rpm
libpng-1.5.13-7.el7_2.x86_64.rpm
ttmkfdir-3.0.9-42.el7.x86_64.rpm
1.2找到字体包
simsun.ttf
2、上传这些包到gitlab
3、通过修改dockerfile文件进行安装
FROM 128.232.8.169:443/tools/tomcatjdk:9021
ARG JOB_NAME
ARG JAR_NAME=$JOB_NAME
COPY ./$JAR_NAME.war /usr/local/tomcat/webapps/
COPY ./cp-encrypt-connection.jar /usr/local/tomcat/lib/
#加入会话共享jar包
COPY ./commons-logging-1.2.jar /usr/local/tomcat/lib/
COPY ./commons-pool2-2.4.2.jar /usr/local/tomcat/lib/
COPY ./jedis-2.9.0.jar /usr/local/tomcat/lib/
COPY ./tomcat-cluster-redis-session-manager-2.0.4.jar /usr/local/tomcat/lib/
#install Chinese fonts
COPY ./libpng-1.5.13-7.el7_2.x86_64.rpm /usr/local/
COPY ./freetype-2.8-14.el7.x86_64.rpm /usr/local/
COPY ./fontconfig-2.13.0-4.3.el7.x86_64.rpm /usr/local/
COPY ./ttmkfdir-3.0.9-42.el7.x86_64.rpm /usr/local/
COPY ./SIMSUN.TTC /usr/share/fontconfig/myfonts/
RUN rpm -ivh /usr/local/libpng-1.5.13-7.el7_2.x86_64.rpm --nodeps --force
RUN rpm -ivh /usr/local/freetype-2.8-14.el7.x86_64.rpm --nodeps --force
RUN rpm -ivh /usr/local/fontconfig-2.13.0-4.3.el7.x86_64.rpm --nodeps --force
RUN rpm -ivh /usr/local/ttmkfdir-3.0.9-42.el7.x86_64.rpm --nodeps --force
RUN ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
RUN sed -i 's/<fontconfig>/&<dir>\/usr\/share\/fontconfig\/myfonts<\/dir>/' /etc/fonts/fonts.conf
RUN fc-cache
网友评论