1. bash-completion
をインストールする
bash
$ brew install bash-completion
2. .bashrc
と.bash_profile
に以下の内容を追加する
.bashrc
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
.bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
3. Dockerのシンボリックリンクを追加する
bash
$ ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion /usr/local/etc/bash_completion.d/docker
$ ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion /usr/local/etc/bash_completion.d/docker-machine
$ ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion /usr/local/etc/bash_completion.d/docker-compose