java1234开源博客系统
博客信息

DockerFile构建自定义Tomcat

0
发布时间:『 2019-11-17 16:43』  博客类别:Docker  阅读(114)

DockerFile构建自定义Tomcat


1,编写DockerFile


FROM centos

MAINTAINER caofeng<caofeng2012@126.com>

 

LABEL name="Java1234 Tomcat Image" \

    build-date="20191115"

    

COPY  copyright.txt /home/copyright.txt

ADD server-jre-8u151-linux-x64.tar.gz /home/

ADD apache-tomcat-8.5.37.tar.gz /home/

 

ENV WORKPATH /home/apache-tomcat-8.5.37/

WORKDIR $WORKPATH

 

ENV JAVA_HOME /home/jdk1.8.0_151

ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

ENV CATALINA_HOME /home/apache-tomcat-8.5.37/

ENV CATALINA_BASE /home/apache-tomcat-8.5.37/

ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin

 

 

EXPOSE 8080

CMD ["/home/apache-tomcat-8.5.37/bin/catalina.sh","run"]


2, 构建 docker build -f myTomcatDockerFile -t java1234/myTomcat:1.1 .


3,运行 docker run -it -p 80:8080 镜像ID

关键字:   无
关注Java1234微信公众号
博主信息
Java1234_小锋
(知识改变命运,技术改变世界)
Powered by Java1234 V3.0 Copyright © 2012-2016 Java知识分享网 版权所有