Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My windows service in the image can't auto start when I start the container #17

Open
dat-trinhtien opened this issue Feb 25, 2020 · 0 comments

Comments

@dat-trinhtien
Copy link

dat-trinhtien commented Feb 25, 2020

Hello guys,
Please help me,
I have built an image windows server core with a windows service inside.
I have set (-StartupType Automatic) to that service, but when the container is online, the service doesn't start.
Here is the command in Dockerfile

New-Service -Name $service_name -DisplayName $service_display_name -Description 'Domain Handlers' -BinaryPathName $service_path -StartupType Automatic

and here is the status of that service I got from the running container.

ExitCode  : 0
Name      : Project-Dev
ProcessId : 0
StartMode : Auto
State     : Stopped
Status    : OK

I also have two solutions for now.
First, I think I can make a script and set it runs in ENDTRYPOINT or CMD, that script will start the service when the container is online.
Second, I saw that the service is running under localsystem permission and have heard about LocalService and NetworkService, so the question is if my service runs under Localservice or networkservice, then It can auto start? (I thought about the permission, maybe the service can't start because of the permission)
So, please help me to get out of these stuffs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant