# 该镜像需要依赖的基础镜像
FROM openjdk:8-jdk-alpine

# 设置自定义标签
LABEL version="1.0.0" maintainer="znzn"

ENV WORKDIR="/data/app"

# 创建工作目录
WORKDIR $WORKDIR

# 将当前目录下的jar包复制到docker容器的工作目录下
COPY ./app/energy.jar ./energy.jar

#设置时区
RUN mkdir ./logs

#设置环境变量
#ENV LANG = "zh_CN.UTF-8" \
#    JAVA_OPTS=" -Duser.timezone=Asia/Shanghai -server -Xmx2048m -Xms2048m -Xss512k " \
#    JAVA_USER=" -XX:+UseFastAccessorMethods -XX:MaxMetaspaceSize=512m -XX:MetaspaceSize=512m  -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=92 -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 " \
#    JAVA_OOM=" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=java_heapdump.hprof "


# 指定docker容器启动时运行jar包
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS $JAVA_USER $JAVA_OOM -Dfile.encoding=utf-8  -jar $WORKDIR/energy.jar "]

