1. #volumes-from 镜像数据传递 共享数据文件夹
    2. docker run -it --name dc04 --volumes-from dc03 mycentos
    3. #docker手动配置Tomcat
    4. FROM centos
    5. ENV BASE_PATH /usr/local
    6. ENV JDK jdk1.8.0_11
    7. ENV TOMCAT apache-tomcat-9.0.52
    8. MAINTAINER freefish<ayu.start@outlook.com>
    9. COPY 1.txt /usr/local/cincontainer.txt
    10. ADD jdk-8u11-linux-x64.tar.gz $BASE_PATH
    11. ADD apache-tomcat-9.0.52.tar.gz $BASE_PATH
    12. RUN yum install -y vim
    13. WORKDIR $BASE_PATH
    14. ENV JAVA_HOME $BASE_PATH/$JDK
    15. ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    16. ENV CATALINA_HOME $BASE_PATH/$TOMCAT
    17. ENV CATALINA_BASE $BASE_PATH/$TOMCAT
    18. ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin
    19. #容器运行时监听的端口
    20. EXPOSE 8080
    21. #启动时运行tomcat
    22. # ENTRYPOINT ["/usrl/local/$TOMCAT/bin/startup.sh" ]
    23. # CMD ["/usr/local/$TOMCAT/bin/catalina.sh","run"]
    24. CMD /usr/local/$TOMCAT/bin/startup.sh && tail -F /usr/local/$TOMCAT/in/logs/catalina.out
    25. #Docker构建
    26. docker build -t selftomcat9 .
    27. #docker 运行
    28. docker run -d -p 9080:8080 --name myt9 -v /root/mydocker/tomcat9/data/test:/usrlocal/apache-tomcat-9.0.52/webapps/test -v /root/mydocker/tomcat9/data/tomcat9logs/:/usrlocal/apache-tomcat-9.0.52/logs --privileged=true selftomcat9