Docker shell completion on OSX iTerm2 oh-my-zsh

Make sure you have the lastest version of oh-my-zsh by running: upgrade_oh_my_zsh

Also, it can't hurt to run rm ~/.zcompdump* after trying all the other answers.

Fixed it for me.


You set up the completion for docker-compose not for docker. If you would like add the docker completion too then run the following command and reload your shell.

curl -L https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/zsh/_docker > ~/.zsh/completion/_docker 

Other solution (UPDATE):

Add the docker plugin to the .zshrc's plugin list:

  1. Open ~/.zshrc
  2. Add docker to the plugins list like this: plugins=(docker ...)