Dockerfile 构建 tomcat 镜像

FROM centos:7

MAINTAINER  lihaozhe<646269678@qq.com>

RUN yum -y install vim tar net-tools

ADD jdk-8u371-linux-x64.tar.gz /usr/local
ADD apache-tomcat-9.0.75.tar.gz /usr/local

ENV JAVA_HOME /usr/local/jdk1.8.0_371

ENV CATALINA_HOME /usr/local/apache-tomcat-9.0.75
ENV CATALINA_BASE $CATALINA_HOME
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin
ENV TZ="Asia/Shanghai"

EXPOSE 8080

CMD /usr/local/apache-tomcat-9.0.75/bin/startup.sh

sudo docker build -t tomcat9 .
sudo docker run --name my_tomcat -p 8080:8080 -d tomcat9
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐