3

I want to deploy my war file on my docker

DOCKERFILE

FROM java:8 EXPOSE 8080 ADD /name.war name.war ENTRYPOINT ["java","-jar","atp.war"] 

I build the image

docker build -f Dockerfile -t name . 

But when i try to run it

docker run -p 8080:8080 -t name 

no main manifest attribute, in name.war

what is this and how do I solve it?

3
  • I never deployed anything before. Usually I just click start with tomcat on intellij and it just works. What else do I need ? What is the main class of a web project?? Commented Jan 26, 2018 at 14:30
  • What is inside the war ? Does it run outside docker container ? Do you need to deploy it to tomcat or any other server ? Commented Jan 26, 2018 at 14:37
  • 1
    Inside the war is a java web application. I need tomcat to deploy on intellij.. Commented Jan 26, 2018 at 14:37

1 Answer 1

3

If you have a war which you want to deploy in tomcat, you should start from a tomcat docker base image. Something like:

FROM tomcat:9-jre8-alpine ADD /name.war /usr/local/tomcat/webapps/ROOT.war 

See the docs for the tomcat base image https://hub.docker.com/_/tomcat/

Sign up to request clarification or add additional context in comments.

1 Comment

No - the tomcat image has everything in it already. All you need to do is put your war in and it should do the rest.