Closed sharathj007 closed 6 years ago
does it work if you change
ADD /*.jar /
to
COPY /*.jar /
The ADD
command extracts local archives, which means it may extract the .jar
Also note that your Dockerfile contains two CMD
; the second will overwrite he first one
Thanks for your suggestion, but i feel like the JRE path is not getting set properly to run the .jar file
Does it work if you set it through ENV
?
ENV JRE_HOME=C:\jre-8u91-windows-x64\jre
(perhaps the back-slashes need escaping, depending on what escape-character is set in the parent image)
Thank you, how can i include JRE_HOME to PATH environment variable
"RUN powershell start-process -filepath C:\jre-8u91-windows-x64.exe " will just start the process but JRE is not getting installed in the container. Due to this i am unable to run the .jar file in the container. Please provide a command to add in the dockerfile to install the JRE from the jre-8u91-windows-x64.exe inside container will be very much helpful.
But why are you installing JRE again? Isn't it already present in the openjdk:nanoserver
image? Here's, for example the example voting app; https://github.com/dockersamples/example-voting-app/blob/fe98cde7f47babebaa502412234ee5a009f4b543/worker/Dockerfile.j
(note that image is using an outdated version of openjdk, but the concept should be the same)
Yeah sir, openjdk:nanoserver has the JRE within. But I am using microsoft/nanoserver as the base image and trying to install the JRE their. The above mentioned "RUN powershell start-process -filepath C:\jre-8u91-windows-x64.exe " wont install the in the container, it will just run and exit.
Here's the Dockerfilie of the official openjdk:nanoserver
image; https://github.com/docker-library/openjdk/blob/873fb56728befef8ecaf8436c3a27fd239cba301/8-jdk/windows/nanoserver-sac2016/Dockerfile, which may provide some hints how to install
Thanks for your inputs, I am able to install the JDK in windowsservercore also successfully and able to run my sample .jar file their. Please let me know the installation commands for VC_redist.x64.exe, visual studio redistributable package through the docker file. Which is very much required to run my real time application as a docker image.
Thanks for your inputs, I am able to install the JDK in windowsservercore also successfully and able to run my sample .jar file their.
Great!
Please let me know the installation commands for VC_redist.x64.exe, visual studio redistributable package through the docker file. Which is very much required to run my real time application as a docker image.
Looks like the first result searching on Google shows this; https://github.com/Microsoft/dotnet-framework-docker/issues/15
Please keep in mind that the GitHub issue tracker is not intended as a general support forum, but for reporting bugs and feature requests. For other type of questions, consider using one of;
I'm closing this issue because this is not a bug, but feel free to continue the conversation 👍
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked
Expected behavior
I have below docker file which has the TestJar.jar file which prints the hello world, when i am adding this into the dockerfile as below and creating an image by giving the below command as "docker build -t sample:jar ." Image is getting created successfully, but when try to run the image instead of showing hello world, which is throwing an error as below:
Actual behavior
When i run the image it should show a message "hello world", which is not happening.
Information
PLEASE let me know how to run a sample .jar file in windows docker container.