Upvotes 0 Share PDF

Docker for Windows freezes with invalid daemon settings

Issue

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:

Resolution

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.

  1. Stop the Docker for Windows service:

  2. Stop the Docker for Windows.exe process:

  3. Navigate to C:\Users\Username\AppData\Roaming\Docker and either delete or rename the settings.json file.

  4. 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.json file based on the default template.