#pull down centos image
FROM centos
MAINTAINER pizy@cloudcc.com
#设置时间差
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
#基本工具安装
RUN yum install -y passwd openssl openssh-server openssh-clients vim wget curl net-tools
#配置ssh
RUN ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key ?-N ''
RUN echo "root:123qwe" | chpasswd
RUN mkdir -p /home/Java/
RUN mkdir -p /home/Data/
#install & config JDK
ADD ./jdk-8u91-linux-x64.tar.gz /home/Java
ENV JAVA_HOME /home/Java/jdk1.8.0_91
ENV PATH $JAVA_HOME/bin:$PATH
#install tomcat
ADD ./apache-tomcat-8.0.12.tar.gz /home/Java
#install & config zookpeeper
ADD ./zookeeper-3.4.9.tar.gz /home/Java
RUN mv /home/Java/zookeeper-3.4.9 /home/Java/zookeeper
RUN cp /home/Java/zookeeper/conf/zoo_sample.cfg /home/Java/zookeeper/conf/zoo.cfg
RUN mkdir -p /home/Java/zookeeper/data
RUN mkdir -p /home/Java/zookeeper/logs
RUN /bin/echo "1" > /home/Java/zookeeper/data/myid
#define entry point which will be run first when the container starts up
#ENTRYPOINT /home/Java/zookeeper/bin/zkServer.sh start
#ENTRYPOINT /home/Java/apache-tomcat-8.0.12/bin/startup.sh && /usr/sbin/sshd -D
#ENTRYPOINT /home/Java/apache-tomcat-8.0.12/bin/startup.sh && tail -F /home/Java/apache-tomcat-8.0.12/logs/catalina.out
#CMD ["/usr/sbin/sshd", "-D"] //不生效,只能用 ENTRYPOINT /usr/sbin/sshd -D
#docker build -t standard:1.0 .
#docker run ?-p 8080:8080 --privileged=true -d -v /home/Data:/home/Data standard:1.0