Trying to run a Java .war file with Docker on Windows server 2016.
With Linux container it can be done by pulling Tomcat image (which is built on top of openJDK and uses Debian as a base image) and adding war file to webapps folder through Dockerfile.
But, Tomcat do not currently has any image for Windows containers, since openJDK too doesn't have support for Microsoft/windowsservercore or Microsoft/nanoserver
In my view, to be able to run war on Tomcat for windows We will need:
To create the final image JDK is downloaded and installed through PS :
The Dockerfile looks like:
FROM windowsservercore
RUN powershell (new-object System.Net.WebClient).Downloadfile('http://javadl.oracle.com/webapps/download/Au toDL?BundleId=210185', 'C:\jre-8u91-windows-x64.exe')
RUN powershell start-process -filepath C:\jre-8u91-windows-x64.exe -passthru -wait -argumentlist "/s,INSTALLDIR=c:\Java\jre1.8.0_91,/L,install64.log"
RUN del C:\jre-8u91-windows-x64.exe
CMD [ "c:\\Java\\jre1.8.0_91\\bin\\java.exe", "-version"]
But I am not sure how to install Tomcat with Environment variables set and then adding war to the webapps Directory.
Heard about WinDocks, but I would like to build without it.
Anyone has some insights on this?