Dockerfile 1.07 KB
FROM java:8

MAINTAINER xueyin  <hongyun.xu@yoho.cn>

ADD Mycat-server-1.6.5-release-linux.tar.gz  /home

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


ENV MYCAT_HOME="/home/mycat"
ENV JAVA_OPTS="-server -Xms2G -Xmx2G -XX:+AggressiveOpts -XX:MaxDirectMemorySize=2G \
               -Xss256k -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:+UseFastAccessorMethods \
               -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled \
               -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly \
               -XX:CMSInitiatingOccupancyFraction=75 -XX:CMSInitiatingOccupancyFraction=75"

ENV MYCAT_CLASSPATH=".:$MYCAT_HOME:$MYCAT_HOME/conf:$MYCAT_HOME/lib:$MYCAT_HOME/lib/classes"

ENV RUN_CMD="java -Djava.ext.dirs=$MYCAT_CLASSPATH -DMYCAT_HOME=/home/mycat -classpath $MYCAT_CLASSPATH $JAVA_OPTS \
             io.mycat.MycatStartup  $@ >> \"$MYCAT_HOME/logs/console.log\" 2>&1 &"

EXPOSE 8066
EXPOSE 9066

VOLUME $MYCAT_HOME/logs

WORKDIR /home/mycat
CMD exec $RUN_CMD