title: Docker: Which approach is better? WAR embedded in image or base image + war?
body: <p>Just started playing around with Docker. To deploy a war on tomcat there seem to be two approaches:</p>
  
  <ol>
  <li>Create image with java + tomcat + war embedded in the image</li>
  <li>Have a base image with java + tomcat and then "inject" the war into the base image (through host volume mount, for example)</li>
  </ol>
  
  <p>Approach 1:</p>
  
  <ul>
  <li>Need to create one image for each build</li>
  <li>Completely bundled solution</li>
  <li>Due to the large image sizes, maintaining one image for each build and sharing the image for downstream deployment could become an issue</li>
  </ul>
  
  <p>Approach 2:</p>
  
  <ul>
  <li>Keep a base image in docker hub</li>
  <li>Add war externally and run</li>
  <li>Smaller distributable size (only war), but additional step that the deployment team needs to 'know' the name of image to run</li>
  </ul>
  
  <p>Which of these approaches is typically used in production?</p>