docker容器字体问题

docker容器字体问题

我们可以通过往容器中/usr/share/fonts/文件夹添加字体的方式解决中文乱码,图片文字乱码的问题。

FROM oraclejdk-1.8.0:latest

WORKDIR /opt/deployments

USER root

ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8

COPY fonts/libpng16.so.16 /usr/lib64
COPY fonts/libfreetype.so.6 /usr/lib64
COPY fonts/libz.so.1 /usr/lib64
COPY fonts/libz.so.1.2.11 /usr/lib64

RUN mkdir -p /usr/share/fonts

COPY fonts/msyh.ttf /usr/share/fonts/
COPY fonts/simfang.ttf /usr/share/fonts/
COPY fonts/simkai.ttf /usr/share/fonts/
COPY fonts/SIMSUN.TTC /usr/share/fonts/
COPY fonts/tahoma.ttf /usr/share/fonts/
COPY ./target/backend.jar /opt/deployments/

RUN \    
	unzip -q backend.jar && \    
	rm -rf backend.jar
	
ENV JAVA_OPTS=" -Xss349K -XX:MetaspaceSize=204857K -Xms681574K -Xmx1000574K -XX:MaxMetaspaceSize=204857K -XX:OnOutOfMemoryError=${JAVA_HOME}/bin/killjava.sh -XX:+ExitOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow"

EXPOSE 25050

CMD java ${JAVA_OPTS} -cp /opt/deployments/. org.springframework.boot.loader.JarLauncher

你可能感兴趣的:(容器技术,docker)