Deploy simple standalone spring mvc application in docker container Deploy simple standalone spring mvc application in docker container docker docker

Deploy simple standalone spring mvc application in docker container


I found the solution , seems like it was because of the some corrupted files in my local repository.

I deleted all the files in local maven repository and downloaded them again. and followed the same steps as above then was able to deploy the war successfully.


I was able to get the example project working. Here are the steps I took to package it.

Download the zip file of the project from here. Unzip and build the project.

cd /path/to/spring-mvc-examplemvn package

Copy the spring-mvc-example.war from the /path/to/spring-mvc-example/targets/spring-mvc-example.war file into the folder with your Dockerfile

My Dockerfile

FROM tomcat:8.0.20-jre8COPY spring-mvc-example.war /usr/local/tomcat/webapps/

Build your docker file

docker build -t so-49579717 .

Run your container.

docker run -p 8080:8080 so-49579717

I don't see any of the errors you did above. As you didn't mention the maven package step, maybe you were trying to package the zip file into the container?