如何在docker部署安装tomcat环境
1个回答
2016-12-17
展开全部
第一步:root用户登录在系统根目录下创建文件夹tomcat7,命令如:mkdir tomcat7,并且切换到该目录下:cd tomcat7;
第二步:创建Dockerfile,命令如:touch Dockerfile;
第三步:编写Dockerfile,命令如:vim Dockerfile,完成以下命令编写:
FROM ubuntu:14.04
MAINTAINER zhaichong <344616313@qq.com>
ENV REFRESHED_AT 2015-7-28
RUN apt-get -yqq update
RUN apt-get -yqq install tomcat7 default-jdk
ENV CATALINA_HOME /usr/share/tomcat7
ENV CATALINA_BASE /var/lib/tomcat7
ENV CATALINA_PID /var/run/tomcat7.pid
ENV CATALINA_SH /usr/share/tomcat7/bin/catalina.sh
ENV CATALINA_TMPDIR /tmp/tomcat7-tomcat7-tmp
RUN mkdir -p $CATALINA_TMPDIR
VOLUME ["/var/lib/tomcat7/webapps/"]
EXPOSE 8080 9000
ENTRYPOINT ["/usr/share/tomcat7/bin/catalina.sh", "run" ]
第二步:创建Dockerfile,命令如:touch Dockerfile;
第三步:编写Dockerfile,命令如:vim Dockerfile,完成以下命令编写:
FROM ubuntu:14.04
MAINTAINER zhaichong <344616313@qq.com>
ENV REFRESHED_AT 2015-7-28
RUN apt-get -yqq update
RUN apt-get -yqq install tomcat7 default-jdk
ENV CATALINA_HOME /usr/share/tomcat7
ENV CATALINA_BASE /var/lib/tomcat7
ENV CATALINA_PID /var/run/tomcat7.pid
ENV CATALINA_SH /usr/share/tomcat7/bin/catalina.sh
ENV CATALINA_TMPDIR /tmp/tomcat7-tomcat7-tmp
RUN mkdir -p $CATALINA_TMPDIR
VOLUME ["/var/lib/tomcat7/webapps/"]
EXPOSE 8080 9000
ENTRYPOINT ["/usr/share/tomcat7/bin/catalina.sh", "run" ]
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询