Docker Community Forums

Share and learn in the Docker community.

Dockerfile and CLI code to locally test a .war file (Docker CE, not Docker EE) [NOT SOLVED] :(

(Dockergi) #1

I finished my first tutorial and I produced a .war file with my IDE. I would like to create a volume on my PC in which to place the .war file. I opened this discussion because I have great difficulty. I believe that the only tool I need is Tomcat.
Also if it was not too difficult I would like to create two images, one with letsencrypt and the other without to test my two different versions of the .war file.
Thank you

P: S .: I’m using docker ce 18.09.0 on Windows 8.1.

(Gary Forghetti) #2

You will need to deploy your war file in a Tomcat docker container.
You will need to create your own custom Tomcat docker image containing your Application war file. That requires you to create a Dockerfile using the Tomcat docker image as the base.

Then in the Dockerfile you will need to copy your war file to the /usr/local/tomcat/webapps directory.

Here is an example that you can use for reference.