Captcha生成验证码,docker部署时问题

 

 

https://blog.csdn.net/huofuman960209/article/details/100738712

Dockerfile

FROM openjdk:8-jdk-alpine
VOLUME /tmp
##时区
RUN echo "Asia/Shanghai" > /etc/timezone
 
#captcher 字体包
RUN set -xe \
&& apk --no-cache add ttf-dejavu fontconfig
 
ADD love-master-0.0.1-SNAPSHOT.jar love-master.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/love-master.jar"]

openjdk:8-jdk-alpine 没有相关字体包,调用createImage()方法时,会报空指针异常,此处已经指定docker容器安装字体包

 

posted @ 2021-02-16 23:29  abcdefghijklmnop  阅读(581)  评论(0编辑  收藏  举报