[root@CentOS02 jar]# cat Dockerfile
FROM openjdk:8-jdk-alpine
#RUN apk add --update --no-cache ttf-dejavu fontconfig && rm -rf /var/cache/apk/*
RUN apk --no-cache add msttcorefonts-installer fontconfig && \
update-ms-fonts && \
fc-cache -f
EXPOSE 8080
VOLUME /slm
ADD jskj-admin-3.7.0.jar /sjz/jskj-admin-3.7.0.jar
COPY lib /sjz/lib
COPY simsun.ttf /usr/share/fonts/truetype/msttcorefonts
CMD [ "java", "-jar","-Duser.timezone=GMT+08", "/sjz/jskj-admin-3.7.0.jar","--spring.profiles.active=prod" ]
如果java读取的时间比数据库中的时间少8个小时,在Dockerfile中添加:
-Duser.timezone=GMT+08