容器 时区

FROM *.*.com//centos7:v3
# 将编译生成的jar包拷贝到镜像中
COPY ./git-resource/purchase-api/target/*.jar /api.jar
COPY  ./config/run.sh /run.sh
# 时区
ENV TZ Asia/Shanghai
RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
    && echo ${TZ} > /etc/timezone
# 设置容器启动命令
CMD ["bash","/run.sh"]
#!/bin/bash
source /etc/profile
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
echo "export LANG=zh_CN.UTF-8" >> /root/.bashrc
echo "export LC_ALL=zh_CN.UTF-8" >> /root/.bashrc
exec java -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8  -Dsun.jnu.encoding=utf-8 -jar /api.jar

 

posted @ 2023-08-25 14:23  大川哥  阅读(8)  评论(0编辑  收藏  举报