Docker Community Forums

Share and learn in the Docker community.

Restart Docker service from command line

docker
(Eivantsov) #1

Hello,

I am trying to stop, start and restart com.docker.service from Windows PowerShell as admin,

PS C:\Windows\system32> net stop com.docker.service
The Docker for Windows Service service is stopping.
A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.

The Docker for Windows Service service was stopped successfully.

PS C:\Windows\system32> net start com.docker.service
The Docker for Windows Service service is starting.
The Docker for Windows Service service was started successfully.

PS C:\Windows\system32> docker ps
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/containers/json: 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 ma
y also indicate that the docker daemon is not running.
PS C:\Windows\system32>

Does anyone know the correct way to restart Docker as a service on Windows 10? Thanks

3 Likes
Error loading image
(Artisticcheese) #2

From powershell prompt following works for me with no issues

restart-service *docker*

1 Like
(Michael Friis) #3

If you’re using Docker for Windows, that comes with it’s own restart and reset in the gui:

What’s going wrong that requires restarts?

3 Likes
(Ryan Cole) #4

Hi Michael (@friism),

What GUI is this in your screenshot? I’m using docker for windows. I don’t seem to have this GUI anywhere.

Thanks!

(Jarwe) #5

After you right clicking docker’s icon in task bar. you’ll see ‘setting’ item in list. it would be open that GUI.

(Raikard) #6

image

When I installed, I got the “Docker Quickstart Terminal”.

You can use this to start/restart.

1 Like
(Nehalbhanushali) #7

Docker Quickstart Terminal comes with Docker Toolbox. Docker toolbox is for older PCs , the latest ones need “Docker for windows” which does not have the Docker Quickstart Terminal. Also, the services show that docker is running, and so does “net start com.docker.service”. But still there is the following error while running docker commands:
“error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.32/images/json: 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.”

(Vladkras) #8

I don’t have GUI but I use Docker QuickStart Terminal and

docker-machine restart

helps

7 Likes
(Zingyrajeev) #9

following. let me know if this is resolved, I am also facing same problem since one month. Not able to fix it till today.

(Philip Lin) #10

I am using Windows 10 Pro N 1803 VM running in Azure. After I restarted com.docker.service, I got the exactly same error message. I tried to use Docker GUI to restart docker, but it doesn’t help. Finally I figured out there are 2 ways to get back Docker to normal.

Solutions
#1 Use Docker GUI to quit docker first; then just run “Docker for Windows.exe”.
#2 Use Docker GUI to reset docker.

Is there possible I can call quit or reset docker from Command Line? I am being blocked for 2 weeks, your help is much appreciated.

1 Like
(Randyfay) #11

I would dearly love to know if anybody figured out a way to do this. I’m perfectly able to “restart-service com.docker.service”, or “net stop com.docker.service” and “net start com.docker.service”. However, doing this never ever results in a usable docker again until doing a restart from the gui.

I note that using the services app results in the same behavior. If you stop “Docker desktop” there and then start it again, you end up with broken docker. Permanently. Although the gui widget is still running and says everything is fine.

#12

I use Windows containers for my development efforts.
I just updated to 2.0.0.3 and hit the same issue.

How I solved it
First I had to delete the “daemon.json” file in “C:\ProgramData\Docker\config” - it seems to have been corrupted by the update. Don’t even try to set ACLs on that file.
Then, I opened the “Docker of Windows” UI from the system tray and I switched to Linux containers.
This will start the MobyLinuxVM in your local Hyper-V.
Check the status of the Docker startup in the “Docker of Windows” UI - it will go from orange to green.
Once the switch-over is done, switch back to Windows containers.
After the running status is green again, do a “docker version” from the command line and you should be golden.

Remember to stop the MobyLinuxVM in your Hyper-V manager.

#13

See my reply on stackoverflow : https://stackoverflow.com/a/55212066/318673

#14

thanks, this is the correct answer