Docker for Windows gives you the ability to configure the Docker daemon through the GUI. Normally it will warn you if there are invalid settings, but occasionally it might let you proceed with a bad configuration. When that happens - Docker hangs up on restarting and cannot be started again even if you manually terminate it. This article walks you through recovering Docker. WARNING - You will lose data. Any Daemon changes or shared drive settings will be reset.
The following example includes an invalid configuration change that Docker accepted. Docker is hung on restarting and eventually errors out:
Eventually, Docker will crash with this message.
Even restarting your computer won't help - Docker still has the invalid config and can't start:
To fix the invalid setting and restart Docker for Windows, use the following steps:
WARNING - You will lose data. Any Daemon changes or shared drive settings will be reset.
Stop the Docker for Windows service:
Docker for Windows.exeprocess:
C:\Users\Username\AppData\Roaming\Dockerand either delete or rename the
Restart Docker — Your system will recognize that the Docker for Windows service is not running and will pop-up a window that allows you to start it. It will also recreate the
settings.jsonfile based on the default template.