Deploying Java webapp to Tomcat 8 running in Docker container

前端 未结 3 841
青春惊慌失措
青春惊慌失措 2020-12-13 05:48

I am pretty new to Tomcat and Docker - so I am probably missing a Tomcat fundamental somewhere in this question.

What I am trying to do is build a Docker container t

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 06:28

    There's a oneliner for this one.

    You can simply run,

    docker run -v /1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.war:/usr/local/tomcat/webapps/myapp.war -it -p 8080:8080 tomcat
    

    This will copy the war file to webapps directory and get your app running in no time.

提交回复
热议问题