Skip to content

Instantly share code, notes, and snippets.

@pasdam
Forked from rkuzsma/docker-bash-completion.md
Last active December 1, 2018 07:42
Show Gist options
  • Save pasdam/1d0b5e75e85253118569940f58329335 to your computer and use it in GitHub Desktop.
Save pasdam/1d0b5e75e85253118569940f58329335 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-ce/master/components/cli/contrib/completion/bash/docker > /usr/local/etc/bash_completion.d/docker

Logout/login to your shell or just run the following:

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