Docker中部署Tomcat,并且部署Java应用程序

Dockerfile

FROM tomcat:9.0-jre8-alpine
MAINTAINER louguanyang 

VOLUME /tmp

ARG JAR_FILE

RUN apk add -U tzdata

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN echo "Asia/Shanghai" > /etc/timezone

RUN apk del tzdata

ADD ${JAR_FILE} /usr/local/tomcat/webapps

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

  pom.xml



    com.spotify
    dockerfile-maven-plugin
    ${dockerfile-maven-plugin.version}
    
        
            default
            package
            
                build
                
                
            
        
    
    
        false
        ${docker.repository}/${docker.image.prefix}/${project.artifactId}
        ${project.version}
        
            target/${project.build.finalName}.war
        
    

  

转载于:https://www.cnblogs.com/louguanyang/p/9589058.html

你可能感兴趣的:(Docker中部署Tomcat,并且部署Java应用程序)