vim Dockerfile
FROM centos:7 MAINTAINER Liuliubin ADD ./apache-tomcat-7.0.99.tar.gz /root ADD ./jdk-7u80-linux-x64.tar.gz /root ENV JAVA_HOME /root/jdk1.7.0_80 ENV PATH $JAVA_HOME/bin:$PATH EXPOSE 8080 ENTRYPOINT /root/apache-tomcat-7.0.99/bin/startup.sh && tail -f /root/apache-tomcat-7.0.99/logs/catalina.out
运行:
docker build -t tomcat:v1.0 .