代码改变世界

基于Linux的DockerFile添加中文字体

2023-02-10 12:12  假面Wilson  阅读(748)  评论(0编辑  收藏  举报
FROM openjdk:8u332-oraclelinux7

#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
#RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig

#在线安装字体
#RUN yum -y install  wget
#RUN wget -O /usr/share/fonts/simsun.ttf https://pfh-file-store.oss-cn-hangzhou.aliyuncs.com/simsun.ttf
#RUN fc-cache -vf
#RUN fc-list

#离线安装字体,先把离线字体文件加入dockerfile目录
COPY front/simsun.ttf /usr/share/fonts/simsun.ttf
#RUN mkfontscale
#RUN mkfontdir
RUN fc-cache -vf
RUN fc-list