Difference between installing service in Windows Container and Windows Server 2016?
I have a service application that will install correctly in Windows Server 2016 Standard using the following command:
PS C:\Service> c:\\mysvc\\mysvc.exe -install Service installed successfully
If I run the same thing when in a Dockerfile using:
RUN c:\\mysvc\\mysvc.exe -install
I get the following output:
The command ‘cmd /S /C c:\svc\mysvc.exe -install’ returned a
non-zero code: 3221225781
I’m not sure why it is behaving differently, or where I could check to get some better ideas as to the cause of the error.
One Solution collect form web for “Difference between installing service in Windows Container and Windows Server 2016?”
A useful tip for debugging this sort of issue is to run the base image in an interactive container, follow the steps for your Dockerfile and see if you get some more useful output.
In your case, something like:
docker run -it --name temp microsoft/windowsservercore cmd
Then in another command on the Windows host:
docker cp mysvc.exe temp:c:/mysvc.exe
And back in the interactive container run
If the output doesn’t help, you could add some more details to your question here – the Dockerfile and some info about the Windows service.