Skip to content

Instantly share code, notes, and snippets.

@ShawonAshraf
Forked from rkuzsma/docker-bash-completion.md
Created September 1, 2018 21:17
Show Gist options
  • Save ShawonAshraf/cccda6d43b4b959040ea8a974c1aac0b to your computer and use it in GitHub Desktop.
Save ShawonAshraf/cccda6d43b4b959040ea8a974c1aac0b to your computer and use it in GitHub Desktop.
How to configure Bash Completion on Mac for Docker and Docker-Compose

How to configure Bash Completion on Mac for Docker 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:

curl -L https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose > /usr/local/etc/bash_completion.d/docker-compose
curl -L https://raw.githubusercontent.com/docker/docker/master/contrib/completion/bash/docker > /usr/local/etc/bash_completion.d/docker

Logout/login to your shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment