#volumes-from 镜像数据传递 共享数据文件夹
docker run -it --name dc04 --volumes-from dc03 mycentos
#docker手动配置Tomcat
FROM centos
ENV BASE_PATH /usr/local
ENV JDK jdk1.8.0_11
ENV TOMCAT apache-tomcat-9.0.52
MAINTAINER freefish<ayu.start@outlook.com>
COPY 1.txt /usr/local/cincontainer.txt
ADD jdk-8u11-linux-x64.tar.gz $BASE_PATH
ADD apache-tomcat-9.0.52.tar.gz $BASE_PATH
RUN yum install -y vim
WORKDIR $BASE_PATH
ENV JAVA_HOME $BASE_PATH/$JDK
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV CATALINA_HOME $BASE_PATH/$TOMCAT
ENV CATALINA_BASE $BASE_PATH/$TOMCAT
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin
#容器运行时监听的端口
EXPOSE 8080
#启动时运行tomcat
# ENTRYPOINT ["/usrl/local/$TOMCAT/bin/startup.sh" ]
# CMD ["/usr/local/$TOMCAT/bin/catalina.sh","run"]
CMD /usr/local/$TOMCAT/bin/startup.sh && tail -F /usr/local/$TOMCAT/in/logs/catalina.out
#Docker构建
docker build -t selftomcat9 .
#docker 运行
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