FROM 47.96.166.136/library/java:v4
MAINTAINER fantasy
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 &&
mkdir /home/admin/server-name/logs -p &&
sed -i "s/server_name/k8s-server-name/g" /home/admin/agent/config/agent.config &&
sed -i "s/sw-ENV/sw_env/g" /home/admin/agent/config/agent.config &&
sed -i "s/SWSERVERIP/server-ip/g" /home/admin/agent/config/agent.config &&
yum -y install fontconfig telnet
ENV LC_ALL zh_CN.UTF-8
ENV LANG zh_CN.UTF-8
ENV JAVA_HOME /usr/local/jdk1.8.0_131
ENV CLASSPATH $JAVA_HOME/lib
ENV PATH $PATH:$JAVA_HOME/bin
COPY jar-dir /home/admin/server-name
WORKDIR /home/admin/server-name
EXPOSE 8081
CMD java -Dfile.encoding=UTF8 \
-Duser.timezone=GMT+08 -Dserver.port=8081 -XmsJVM_MEM -XmxJVM_MEM -Xss256K \
-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=80 -XX:MaxDirectMemorySize=256m \
-XX:+UseCMSInitiatingOccupancyOnly -XX:SurvivorRatio=8 -XX:+ExplicitGCInvokesConcurrent -XX:MetaspaceSize=256m \
-XX:MaxMetaspaceSize=256m -XX:-OmitStackTraceInFastThrow -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:./logs/gc.log \
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=10m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./logs/ \
-Djava.io.tmpdir=./logs/ -jar \${jar-name} --spring.profiles.active=server-env