# 该镜像需要依赖的基础镜像
#FROM --platform=linux/amd64 jdk8:latest
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/openjdk:8-alpine-linuxarm64


# 指定维护者的名字
MAINTAINER shiyue
# 设置自定义标签
LABEL version="1.0.0"

# 创建工作目录
RUN mkdir -p /data/app/logs

# 生成接口挂载点
#VOLUME ["/data/app/logs"]

# 将当前目录下的jar包复制到docker容器的/目录下
ADD target/*.jar /data/app/energy-manage-service.jar

#设置时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#RUN echo 'Asia/Shanghai' >/etc/timezone

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


# 声明运行端口
EXPOSE 16200

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

