Skip to content

Instantly share code, notes, and snippets.

@steevehook
Forked from rkuzsma/docker-bash-completion.md
Last active November 9, 2018 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steevehook/2f2bb66120457bc1f0bba5fc21931e70 to your computer and use it in GitHub Desktop.
Save steevehook/2f2bb66120457bc1f0bba5fc21931e70 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

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"

Add the symlinks:

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

Logout/login to your shell.

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