- Docker Quick Start Guide
- Earl Waud
- 222字
- 2021-06-10 19:07:04
Installing Docker command-line completion
Install Homebrew. You may (probably) already have Homebrew installed on your Mac, but if not, you should install it now. Here is the command to install it:
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Next, use Homebrew to install bash-completion. Here is the command:
# use homebrew to install bash completion
brew install bash-completion
The installation of bash-completion will instruct you to add the following line to your ~/.bash_profile file:
# update the bash profile to enable bash completion for every terminal session
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
Now, create the links necessary to enable the Docker command-line completion feature. There is one link for each of the Docker toolsets. Here are the link commands for bash (if you use zsh, check the next code block for the link commands):
# create links for bash shell
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion $(brew --prefix)/etc/bash_completion.d/docker
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion $(brew --prefix)/etc/bash_completion.d/docker-machine
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion $(brew --prefix)/etc/bash_completion.d/docker-compose
Note that if you are using zsh instead of bash, the link commands are different. Here are the link commands for zsh:
# create links for zsh shell
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion /usr/local/share/zsh/site-functions/_docker
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.zsh-completion /usr/local/share/zsh/site-functions/_docker-machine
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion /usr/local/share/zsh/site-functions/_docker-compose
Finally, restart your terminal session—you can now use Docker command completion! Try it by typing docker and hitting the Tab key twice.
- 大學計算機信息技術導論
- 腦動力:Linux指令速查效率手冊
- 現代測控電子技術
- 可編程控制器技術應用(西門子S7系列)
- 永磁同步電動機變頻調速系統及其控制(第2版)
- 統計策略搜索強化學習方法及應用
- 統計學習理論與方法:R語言版
- 工業機器人維護與保養
- 基于企業網站的顧客感知服務質量評價理論模型與實證研究
- Building a BeagleBone Black Super Cluster
- Applied Data Visualization with R and ggplot2
- 格蠹匯編
- R Data Analysis Projects
- Visual Studio 2010 (C#) Windows數據庫項目開發
- HBase Essentials