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.
- I ran
docker context list
. I saw 2 contexts available (default
, which was active, with the description ‘Current DOCKER_HOST based configuration’; anddesktop-linux
with no description and an endpoint piped to dockerDesktopLinuxEngine.) - I changed my docker context:
docker context use desktop-linux
- 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
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.For me I had configure ~/.docker/config.json with only