MacOS下Docker命令自动补齐

前提条件

己经安装了Homebrew

安装步骤

  • 安装bash-completion包
#Install bash-comletion
brew install bash-completion    #(new command)
brew tap homebrew/completions    #(old command)
  • 更新用户家目录下的.bashrc.bash_profile文件
#update .bashrc or .bash_profile
cat >> ~/.bashrc <
  • 添加docker的补全脚本到bash_completion的脚本目录
#Add Docker-specific completions
cd /usr/local/etc/bash_completion.d
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion

*好了 可以享受你的Docker之旅了 _ *

你可能感兴趣的:(MacOS下Docker命令自动补齐)