How to start Docker daemon (windows service) at startup without the need to log-in?

此生再无相见时 提交于 2019-12-04 09:38:45

问题


We have Docker for Windows installed on a Windows Server 2016 Datacenter box.

We use this box as a build agent for our docker containers.

When we try to connect to this box via the daemon to build a container, we get an error message indicating the daemon is not running (at end of post).

However, if I login to this box using my AD Account, the daemon starts, runs, and then I can connect and do everything I need to do.

Is there a way to make daemon start at boot without requiring the user to be logged in? The service only seems to run if a user is logged in.

Error message:

error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=[NameRemovedForPrivacy]&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=[keyRemovedForPrivacy]&shmsize=0&t=[serverNameRemovedForPrivacy]&target=&ulimits=null: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

What I have tried:

  • Verified Docker was listed in Windows Services and configured to start automatically.
  • Created entries in Windows Task Scheduler to execute docker executable and com.service.docker at boot with eleveated priveleges.

回答1:


I can confirm eckes' comment above. Nothing seems to work. I was very diligent with setting up the Task Scheduler to run under the SYSTEM user with elevated priveleges, etc. and still no luck.

I did find one solution that requires third party software. The software AlwaysUp allows Docker to run at startup without the need to login.

I followed the instructions, except rather than Docker Tools as the executable to run, I pointed to reference\dockerd.exe. Restarted the server, and sure enough I can now connect to my remote daemon.

I recommend this approach as the simplest solution.



来源:https://stackoverflow.com/questions/51252181/how-to-start-docker-daemon-windows-service-at-startup-without-the-need-to-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!