Dockerfile内容如下:
#基于 centos:6 镜像
FROM centos:6
#信息
MAINTAINER hxguang <hxguang@ectrip.com>
#安装 ssh-server ,vim
RUN yum install -y openssh-server vim
#把java与tomcat添加到容器中
ADD jdk1.7.0_80 /usr/local/jdk1.7.0_80
ADD apache-tomcat-7.0.73 /usr/local/tomcat
#配置java与tomcat环境变量
ENV JAVA_HOME /usr/local/jdk1.7.0_80
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin
#暴露端口
EXPOSE 22 8080
#启动tomcat
ENTRYPOINT /usr/local/tomcat/bin/startup.sh && tail -F /usr/local/tomcat/logs/catalina.out