Dockerfile

#pull down centos imagelinux

FROM centosdocker

 

MAINTAINER pizy@cloudcc.comapache

 

#設置時間差vim

RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezonecentos

 

#基本工具安裝tomcat

RUN yum install -y passwd openssl openssh-server openssh-clients vim wget curl net-toolsssh

 

#配置sshcurl

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 ''ui

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

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息