Spring MVC and Docker Newbie

I’ve built a lot of Spring MVC apps over the years, and did so locally. I’ve been able to deploy my WAR file to a local tomcat and that all works fine. I’ve even had Jenkins auto build and deploy to Tomcat, again all works great.

I want to take my WAR file and deploy it to AWS. I see that I need to use Elastic Beanstalk to do this, and it seems there are one or two ways to do this:

  1. Create a JDK 1.8 and Tomcat 8 container with Elastic Beanstalk. I presume this container will get an IP address, and then I can SSH into it, and deploy my war.

  2. I can create a Docker Container, I guess the default container has Ubuntu, though I’d prefer it have CentOS, then I would add the JDK 1.8 to this container along with Tomcat 8, and then deploy my war file to here. Then I could deploy this Docker container to Elastic Beanstalk.

So which is better? What are the pros and cons of each method? Thanks!