markdown 如何在Mac上为Docker和Docker-Compose配置Bash Completion

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何在Mac上为Docker和Docker-Compose配置Bash Completion相关的知识,希望对你有一定的参考价值。

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.

以上是关于markdown 如何在Mac上为Docker和Docker-Compose配置Bash Completion的主要内容,如果未能解决你的问题,请参考以下文章

markdown 在Mac上运行UI Docker应用程序

如何在未配置的 Docker 上为 centos 7 删除/安装 docker 映像

如何在 mac 上为 python 安装 dlib?

如何在 Mac 上为 Qt 设置徽章通知

markdown 在Docker for Mac Moby VM中获取Shell

markdown Mac OS X上的Docker Machine