skip to Main Content

I changed my docker context. Now when I run any docker command, I get protocol not available. How do I change my context back if I can’t run any docker commands?

Basically I did the following.

  1. I ran docker context list. I saw 2 contexts available (default, which was active, with the description ‘Current DOCKER_HOST based configuration’; and desktop-linux with no description and an endpoint piped to dockerDesktopLinuxEngine.)
  2. I changed my docker context: docker context use desktop-linux
  3. Now I can’t do any docker commands, including changing my context back.

I’m running Docker Desktop on Windows using the WSL2 backend (Debian 10). Kubernetes is enabled and kubectl still functions as expected.

How do I fix my docker install so that I can run commands again?

I’ve tried:

  • restarting the WSL
  • restarting Docker Desktop
  • ‘factory reset’ of Docker Desktop

2

Answers


  1. In the file ~/.docker/config.json there will be a "currentContext": "some-name" line. You can delete this line to return to the default context. If that’s the last line, make sure to delete the comma on the previous line to keep the json valid.

    Login or Signup to reply.
  2. For me I had configure ~/.docker/config.json with only

    {
      "credsStore": "desktop.exe"
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search