Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save riccardo-felipe/a4b21bd929a9e682127493ee57d9b178 to your computer and use it in GitHub Desktop.
Save riccardo-felipe/a4b21bd929a9e682127493ee57d9b178 to your computer and use it in GitHub Desktop.

How to set-up bash completion on Mac for Docker, Docker Machine and Docker-Compose

Run:

brew install bash-completion

Add the following lines to your ~/.bash_profile:

  if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
  fi

Run:

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

Logout/login to your shell or run:

source $HOME/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment