码迷,mamicode.com
首页 > 其他好文 > 详细

dockerfile部署tomcat+jdk

时间:2019-03-15 17:12:42      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:net-tools   volume   unzip   mirror   app   info   dir   dock   iproute   

FROM centos:7
MAINTAINER www.ctnrs.com

ENV VERSION=8.0.46

RUN yum install wget curl unzip iproute net-tools -y &&      yum clean all &&      rm -rf /var/cache/yum/*
COPY  jdk-8u45-linux-x64.tar.gz /
RUN tar zxf jdk-8u45-linux-x64.tar.gz -C /usr/local/    

#RUN yum install java-1.8.0-openjdk wget curl unzip iproute net-tools -y && #    yum clean all && #    rm -rf /var/cache/yum/*

#RUN wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat-8/v${VERSION}/bin/apache-tomcat-${VERSION}.tar.gz && COPY apache-tomcat-8.0.46.tar.gz /
RUN  tar zxf apache-tomcat-${VERSION}.tar.gz &&     mv apache-tomcat-${VERSION} /usr/local/tomcat &&     rm -rf apache-tomcat-${VERSION}.tar.gz /usr/local/tomcat/webapps/* &&     mkdir /usr/local/tomcat/webapps/test &&     echo "ok" > /usr/local/tomcat/webapps/test/status.html &&     sed -i ‘1a JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"‘ /usr/local/tomcat/bin/catalina.sh &&     ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#ENV PATH $PATH:/usr/local/tomcat/bin
#ENV JAVA_HOME /usr/local/jdk1.8.0_45
ENV JAVA_HOME /usr/local/jdk1.8.0_45
ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin

WORKDIR /usr/local/tomcat

EXPOSE 8080
CMD ["catalina.sh", "run"]

 docker run  

docker volume create tomcat_vol

 

docker run -itd --name tomcat -p 8080:8080 -v tomcat_vol:/usr/local/tomcat/webapps tomcat:v1

 

dockerfile部署tomcat+jdk

标签:net-tools   volume   unzip   mirror   app   info   dir   dock   iproute   

原文地址:https://www.cnblogs.com/Carr/p/10538183.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!