Best way of deploying a java app on Marathon

275 Views Asked by At

As far as I understand how it works, I see two slightly different methods :

  1. Method 1
  • build a docker image containing all the stuff I need for my java app (the JAR for my app and the various JARs libraries).
  • push the docker image on a repository (dockerhub)
  • give the name of the image to marathon (using “docker” : {“image”: name_of_my_image}))

but the main drawback of is that I have to build/push a new image every time I make a modification to my application code

  1. Method 2
  • build a docker image containing only the JARs that my application depends on (but without the JAR of my application)
  • push this image on a repository
  • put the JAR of my app on a web server
  • give the name of the image to marathon and indicate the uris pointing to my web server to marathon
  • ask marathon to use my image

every time I need to modify my image, I just have to push it on the web server.

Is the second method the correct way ? or does it exist other better approaches ?

0

There are 0 best solutions below