Deploy Spring Boot WAR to Tomcat in Docker Container

Learn How to develop and deploy your Spring Boot war application to a Remote Apache Tomcat Server running in a Docker Container.
Covers building a Docker Image through the Spotify Apache Maven plugin and a Dockerfile.
As a bonus, I'll show you how to use the Spotify plugin to push your Docker Image to a public Docker Hub repository. This Java tutorial uses the Netbeans 8.2 IDE which also runs in its own Docker Container so you'll learn how to have it communicate with the Docker host in order for your Docker Image to be built.
I'll demo the basic Docker commands you need to know from the command line to start, stop and view the logs in your Apache Tomcat 8.5 Docker Container.
You can download the docker image tutorial straight from DockerHub by executing ...
docker pull mvpjava/springboot_docker_tomcat
If you want to learn how to Setup your Netbeans IDE (or any really) in a Docker Container then Click on the link below to see the video "Docker for your Java Development Environment" ...
• Docker for your Java D...
==============================================
Subscribe to MVP Java ...
kzread.info?sub...
Follow me ...
Website: www.mvpjava.com
Google+ : bit.ly/1Jsnnfj
Facebook: / mvpjava
Twitter : / mvpjava

Пікірлер: 42

  • @chandrasharma7774
    @chandrasharma77746 жыл бұрын

    Very interesting and helpful!!

  • @MVPJava

    @MVPJava

    6 жыл бұрын

    Thank-you

  • @josephwong2832
    @josephwong28324 жыл бұрын

    Thanks a lot for those explanations.

  • @MVPJava

    @MVPJava

    4 жыл бұрын

    My pleasure! I´m glad you found it useful

  • @ahmedschhaider4762
    @ahmedschhaider47625 жыл бұрын

    You are the Boss Man !!

  • @MVPJava

    @MVPJava

    5 жыл бұрын

    Wow, thanks Ahmed. Glad you liked it!

  • @lalitbhamare
    @lalitbhamare7 жыл бұрын

    Really good article

  • @MVPJava

    @MVPJava

    7 жыл бұрын

    Thanks! I had lots of fun putting this one together.

  • @sergeikharchikov1157
    @sergeikharchikov11574 жыл бұрын

    Thank you very much, sir !

  • @MVPJava

    @MVPJava

    4 жыл бұрын

    Your Welcome! I am planning to come out with some new Java Docker content in the near future to cover changes that have occurred since I made these. Hit the notification bell to be informed when those come out!

  • @lotaleta
    @lotaleta5 жыл бұрын

    Hello, If I have an existed java application, Do I apply the same steps?.....thank you for the tutorial it is amazing

  • @lov3r33
    @lov3r337 жыл бұрын

    Hi, thanks for the tutorial. Can you please provide the docker-compose.yml file ?

  • @misterxnordic
    @misterxnordic6 жыл бұрын

    could you please mention other maven dependencies instead of spotify

  • @vipinjain5829
    @vipinjain58296 жыл бұрын

    I am getting no main manifest attribute, in /usr/local/tomcat/webapps/,,, what can be the error

  • @ramesh_panthangi
    @ramesh_panthangi5 жыл бұрын

    Colud i know the font that you are used in? Thanking you.

  • @HectorFlores-sp9ok
    @HectorFlores-sp9ok6 жыл бұрын

    I have an error [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project quality: Exception caught: COPY failed: stat /var/lib/docker/tmp/docker-builder162977837/quality-0.0.1-SNAPSHOT.war: no such file or directory ->] COPY quality-0.0.1-SNAPSHOT.war /usr/local/tomcat/webapps/qr-app.war

  • @adizergu
    @adizergu5 жыл бұрын

    great tutorial, thanks! can you please upload the to a git repo ?

  • @MVPJava

    @MVPJava

    5 жыл бұрын

    Hi +Dinca Adrian. You can download the docker image tutorial straight from DockerHub by executing ... "docker pull mvpjava/springboot_docker_tomcat". I actually just added that to the description of the video since it seems I forgot! Thanks for pointing that out

  • @ArnaudVandyck
    @ArnaudVandyck7 жыл бұрын

    Hi, Great tutorial. By the way, you don't need a tomcat image but a java image. Your entry point launches the spring boot application (the tomcat in it), not the tomcat from the docker image. Cheers,

  • @MVPJava

    @MVPJava

    7 жыл бұрын

    Thanks and yes that is another way to look at it!

  • @ArnaudVandyck

    @ArnaudVandyck

    7 жыл бұрын

    No, it is not ;-) If you start the spring-boot application you do not need a tomcat docker image (a java one is enough) and you don't need to rename the jar as a war. If you use a tomcat docker image, you should change the dependency in your application to set tomcat as "provided" and leave the entry point of the tomcat docker image ;-) spring.io/guides/gs/convert-jar-to-war/

  • @MVPJava

    @MVPJava

    7 жыл бұрын

    +Arnaud Vandyck, Just want to clarify, is your intent to deploy on an embedded Tomcat Server or a real remote tomcat server? I get the felling your leaning on embedded? Please confirm.

  • @ArnaudVandyck

    @ArnaudVandyck

    7 жыл бұрын

    What was YOUR intent? ;-) In your presentation, you are running your web app in the version of Spring boot, not the tomcat of the docker image! You can run your demo in a tomcat9 docker, it'll be a tomcat8.5 that runs your application ;-) docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html If you want the tomcat of the docker to do the job, you must not redefine the entry point and leave /bin/sh from the parent image. Tomcat define CMD=catalina.sh run to run tomcat. stackoverflow.com/questions/35452760/difference-between-cmd-and-entrypoint-in-dockefile/35453524 Or maybe I did not understand your presentation ;-) Cheers,

  • @Kriishna47

    @Kriishna47

    7 жыл бұрын

    @Arnaud : I guess he just ran a Simple Spring Boot application in Docker ?

  • @gasperlf
    @gasperlf7 жыл бұрын

    this exmaple is public code?

  • @MVPJava

    @MVPJava

    7 жыл бұрын

    Hi +Lewis Florez Do you mean if its available on an online repository like GitHub?

  • @gasperlf

    @gasperlf

    7 жыл бұрын

    yes, I do. is it?

  • @MVPJava

    @MVPJava

    7 жыл бұрын

    This particular one is not on GitHub however the one with Tomcat + MongoDb is. Also the Docker image for the tutorial your asking for is available on MVP Java's DockerHub account

  • @MrCaste86

    @MrCaste86

    6 жыл бұрын

    Hi, great tutorial! In the first place, thanks! Could you upload this code in github ? I know that the full code is available, but just to have a more simple example, cause there are different tutorials and goals. For example In my case I do not need the mango config :)

  • @jeeperscreepers7
    @jeeperscreepers75 жыл бұрын

    Netbeans? Why?

  • @MVPJava

    @MVPJava

    5 жыл бұрын

    Not the first time I hear this, I'll be switching to IntelliJ or Eclipse for some future videos.

  • @alesblaze4745
    @alesblaze47454 жыл бұрын

    May you provide the source code of this app!

  • @MVPJava

    @MVPJava

    4 жыл бұрын

    HI Arjun. Looks like I mis-placed it, so you can get something very similar to this tutorial from my GitHub account here for now ..github.com/mvpjava/springBootDockerTomcatMongodb I'll take a look soon on how I can put it back on GitHub. Thanks for bringing it to my attention! Thanks for watching.

  • @cafeta
    @cafeta6 жыл бұрын

    Dont do WAR, do JAR!

  • @MVPJava

    @MVPJava

    6 жыл бұрын

    I think I'm gonna write that on my next T-shirt for work! Love it.

  • @jeeperscreepers7

    @jeeperscreepers7

    5 жыл бұрын

    Make JAR not WAR