1、安装地址
⚠️注意版本,分Intel chip和 Apple chip版,M芯片的都安装Apple chip版
2、查看终端使用的SHELL
macos@macosdeMac-Pro ~ % echo $SHELL
/bin/zsh
macos@macosdeMac-Pro ~ %3、查看是否存在补全脚本
macos@macosdeMac-Pro ~ % ls /Applications/Docker.app/Contents/Resources/etc/
docker-compose.bash-completion docker-compose.zsh-completion docker.fish-completion
docker-compose.fish-completion docker.bash-completion docker.zsh-completion
macos@macosdeMac-Pro ~ %4、根据自己SHELL设置好软连接
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion _docker
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion _docker-compose5、重新加载终端使用Tab键检查补全是否正常
macos@macosdeMac-Pro ~ % docker image
image -- Manage images
images -- List images