Zsh Docker Plugin not Working

You might want to try and remove any .zcompdump-(...) files you may have on your user's home directory - using something like rm ~/.zcompdump* on a terminal, or some file browser - and then reload the .zschrc file with the command source ~/.zshrc or restart the terminal - whichever works best for you. See this

Then see if it works.


It seems oh-my-zsh is not loading plugins/docker/_docker file. You must add it to ~/.zshrc in an another way. Add these lines to your ~/.zshrc file:

fpath+=($ZSH/plugins/docker)
autoload -U compinit && compinit

For me it was simply the case that I needed to launch Docker for the first time from spotlight on my Mac in order for Docker for Desktop to get the access it needed. Then the docker version command worked just fine.


In my case: Windows 10 + WSL2 + Hyper

I was having this error because I stopped Docker on Windows... Starting it again makes the error disappear in Hyper (thus, also in ZSH).

No .zshrc changes or additional commands to add inside.