title: Deploy simple standalone spring mvc application in docker container
body: <p>I have to deploy simple standalone spring mvc application in docker container. <a href="https://www.journaldev.com/14476/spring-mvc-example" rel="nofollow noreferrer">I started with this application</a> and haven't been able to find a solution to deploy it within docker.</p>
  
  <p>My Dockerfile:</p>
  
  <pre><code>FROM tomcat:8.0.20-jre8
  COPY spring-mvc-example.war /usr/local/tomcat/webapps/
  </code></pre>
  
  <p>I am getting the following error when I execute </p>
  
  <pre><code>sudo docker run -p 8080:8080 springmvc
  </code></pre>
  
  <p>ERROR </p>
  
  <pre><code>org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/spring-mvc-example]]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@77c87bba]
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4840)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4970)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 10 more
  Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@27179421]
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
      at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:699)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 13 more
  Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid CEN header (bad signature)
      at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:96)
      at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
      ... 16 more
  Caused by: java.util.zip.ZipException: invalid CEN header (bad signature)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:220)
      at java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:150)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:166)
      at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:103)
      at org.apache.catalina.webresources.JarResourceSet.initInternal(JarResourceSet.java:88)
      ... 17 more
  
  30-Mar-2018 18:33:40.268 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /usr/local/tomcat/webapps/spring-mvc-example.war
   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/spring-mvc-example]]
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>