dockerdocker-for-windowsdocker-desktop

Docker Desktop for Windows Dashboard runs but not Docker itself


I'm trying to start out with Docker and finding the environment on Windows very frustrating. About half the time I start my laptop Docker Desktop for Windows does not seem to start correctly.

Symptoms:

  1. Whale icon in system tray does not have any containers on its back:

enter image description here

  1. Right-clicking on the whale icon in the system tray shows only two items in the context menu - Dashboard and Settings:

enter image description here

  1. When the dashboard is open, the Docker and Kubernetes icons at bottom left are greyed out, and hovering over them show they are stopped:

enter image description here

  1. In the dashboard, if I select Settings, it hangs indefinitely trying to open the settings window:

enter image description here

  1. In the dashboard Troubleshoot window, the Restart button is greyed out:

enter image description here

I've tried restarting both the Docker Engine and the Docker Desktop Service in the services console. That made no difference. The only thing that seems to work is repeatedly restarting the machine until Docker Desktop for Windows runs. That's a less than ideal solution, however. Has anyone a better way of fixing this issue?

By the way, this is running Linux containers, with Kubernetes enabled.


Solution

  • The following Stackoverflow answer, https://stackoverflow.com/a/67091896/216440, suggested using DockerCLI -SwitchDaemon to fix a similar issue, by switching from using Windows containers to Linux containers, or vice versa.

    I tried it but it didn't fix the problem. However, it was the basis for something that did work.

    What did work for me was forcing the daemon to use Linux containers, by running the following command in PowerShell:

    & 'C:\Program Files\Docker\Docker\DockerCLI.exe' -SwitchLinuxEngine

    I was already using Linux containers but, nonetheless, running that command got Docker Desktop for Windows working again.

    NOTE: Don't restart your machine after running the command above. It fixes the issue immediately, without the need for a restart. You may encounter the issue again the next time you restart your machine. In that case just re-run the above command to fix the issue.

    The equivalent command to force the use of Windows containers may also work, although I haven't tried it:

    & 'C:\Program Files\Docker\Docker\DockerCLI.exe' -SwitchWindowsEngine