无权限的运维
无权限的运维
发布于 2025-11-23 / 99 阅读
0
0

Macos安装Docker后命令补全

1、安装地址

Macos的Docker Desktop安装地址

⚠️注意版本,分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-compose

5、重新加载终端使用Tab键检查补全是否正常

macos@macosdeMac-Pro ~ % docker image
image   -- Manage images
images  -- List images


评论