Command-line Completion

Command-line Completion

Docker Machine comes with command completion for the bash shell.

Installing Command Completion

Bash

Make sure bash completion is installed. If you use a current Linux in a non-minimal installation, bash completion should be available. On a Mac, install with brew install bash-completion

Place the completion scripts in /etc/bash_completion.d/ (`brew --prefix`/etc/bash_completion.d/ on a Mac), using e.g.

files=(docker-machine docker-machine-wrapper docker-machine-prompt)
for f in "${files[@]}"; do
  curl -L https://raw.githubusercontent.com/docker/machine/v$(docker-machine --version | tr -ds ',' ' ' | awk 'NR==1{print $(3)}')/contrib/completion/bash/$f.bash > `brew --prefix`/etc/bash_completion.d/$f
done

Completion will be available upon next login.

doc_docker
2017-02-04 08:21:46
Comments
Leave a Comment

Please login to continue.