microsoft/nanoserver docker image fails to start java.exe, while microsoft/windowsservercore succeeds microsoft/nanoserver docker image fails to start java.exe, while microsoft/windowsservercore succeeds docker docker

microsoft/nanoserver docker image fails to start java.exe, while microsoft/windowsservercore succeeds


This mostly appears to be a installation issue. One your step 3

Step 3/5 : 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"

It is running successfully in terms of exit code but may be installer is running into some problems. You should run a shell and check if the installer workd

docker run -it java-nano:jre1.8.0_91 powershell

Also you can try and reinstall and see if there is any error that you get out of the installer. Might be some dependencies not being present


I zipped the current JRE installation of my laptop (C:\Program Files\Java\jre1.8.0_221) into jre1.8.0_221.zip. Then used the dockerfile:

FROM mcr.microsoft.com/windows/nanoserver:10.0.14393.1066COPY jre1.8.0_221.zip c:\\jre1.8.0_221.zipRUN powershell Expand-Archive -Force c:\jre1.8.0_221.zip c:ENV JAVA_HOME "C:\jre1.8.0_221"ENV PATH "C:\jre1.8.0_221\bin"CMD java -version

It worked for me.