dockerwindows-server-2016linux-containersosrm

Docker Service stops when I log out from Windows


I am trying to implement OSRM as a service on Windows server 2016.

I installed Docker Community Edition 17.06.0-ce-win18 2017-06-28 and implemented OSRM as a service.

But the issue I want to refer is:

The service stops when I log out from the windows.

I want the service running while the server is logged off.

Is there any method I can apply to achieve this ?


Solution

  • Though it is a late response, I think it will be useful for someone still looking for an answer

    In windows server, the best option is to use Docker desktop which is simple to use and having flexibility of allocating memory and swap. But the major issue here is the docker desktop stops functioning when the user log off from the server. It is because, Docker desktop needs a daemon running in the background as a process and upon logout the process will get stopped.

    But there is a catch, instead of logging out we can 'disconnect' from the server and ensure the process is running without any interruption.

    enter image description here

    And it does not end here. Once you disconnect from the server, there is a fixed time limit which is 3 hours till the processes running and then it stops.

    But wait..we have alternative to prevent this from happening. I wonder why Microsoft has not made enough documentation on this..! There is a timeout setting option in Windows servers which can be accessed like below

    Start > Edit group policy > Computer configuration > Administrative templates > Windows components > Remote desktop services > Remote desktop session host > Session time limits

    Under this section there are 5 options out of which 1st one is to set the time limit for disconnected sessions. You need to enable it and set the value as 'Never'. Also, the other 3 options change to 'Disabled' from 'Not Configured'. 5th option is related to log off and this is up to the user requirement.

    enter image description here

    Once these are done, you can disconnect from server and Docker engine will work fine in the background. Your containers will work uninterrupted

    I hope this helps Thank you