Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker "protocol not available" after context change

Tags:

docker

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
like image 278
Roddy of the Frozen Peas Avatar asked Nov 24 '25 22:11

Roddy of the Frozen Peas


1 Answers

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.

like image 107
BMitch Avatar answered Nov 27 '25 13:11

BMitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!