Unable to get zsh auto-completion working with Docker on Fedora 33

Hi everyone,

I cannot get auto-completion working for Docker commands with zsh.

With Bash, if I run docker images and double tab, I can see the list of images.

With Zsh, there is no auto-completion at all.

I even deleted the .zshrc and created a new one but the same issue occurs.

The auto-completion with zsh works fine with the system commands like cd , etc ,ls,…

I installed Fedora 33 from scratch with all the updates.

Then,I installed docker engine manually from the official doc Install Docker Engine on Fedora | Docker Documentation

I then installed the cli completion from following the instruction in Command-line completion | Docker Documentation

~/.zcompdump* have been removed.

echo $fpath

/home/marc/.zsh/completion /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.8/functions

cat ~/.zshrc
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i

logout and login again: same issue

Thank you for your help

SOLVED

For the ones you will get the same issue, first you need to add the file _docker from GitHub - felixr/docker-zsh-completion: [OUTDATED] zsh completion for docker; use https://github.com/docker/cli instead as it has been explianed above but also you have to add these 2 lines below in . zshrc to enable the Docker commands with the zsh shell.

zstyle ':completion:*:*:docker:*' option-stacking yes

zstyle ':completion:*:*:docker-*:*' option-stacking yes

1 Like