需安装 Docker Desktop 的 Mac 或者 Windows 版本,如果没有请下载下载 Docker CE最新版本 当前 master 分支已经在 Docker for Mac/Windows 2.5.0.0 (包含 Docker CE 20.10.0 和 Kubernetes 1.19.3) 版本测试通过. Give feedback and get help. To get help from the community, review current user topics, join or start a discussion, log on to our Docker Desktop for Mac forum. To report bugs or problems, log on to Docker Desktop for Mac issues on GitHub, where you can review community reported issues, and file new ones.

Estimated reading time: 3 minutes

Docker desktop vs brew

Docker Desktop Brewers

Compose comes with command completionfor the bash and zsh shell.

Install command completion

Bash

Docker Desktop Brew

Make sure bash completion is installed.

Linux

  1. On a current Linux OS (in a non-minimal installation), bash completion should beavailable.

  2. Place the completion script in /etc/bash_completion.d/.

  3. Reload your terminal. You can close and then open a new terminal, or reload your setting with source ~/.bashrc command in your current terminal.

Mac

Install via Homebrew
  1. Install with brew install bash-completion.
  2. After the installation, Brew displays the installation path. Make sure to place the completion script in the path.

    For example, place the completion script in /usr/local/etc/bash_completion.d/.

  3. Add the following to your ~/.bash_profile:

  4. You can source your ~/.bash_profile or launch a new terminal to utilizecompletion.
Install via MacPorts
  1. Run sudo port install bash-completion to install bash completion.

  2. Add the following lines to ~/.bash_profile:

  3. You can source your ~/.bash_profile or launch a new terminal to utilizecompletion.

Docker Desktop Brew

Zsh

Make sure you have installed oh-my-zsh on your computer.

With oh-my-zsh shell

Add docker and docker-compose to the plugins list in ~/.zshrc to runautocompletion within the oh-my-zsh shell. In the following example, ..represent other Zsh plugins you may have installed.

Without oh-my-zsh shell

  1. Place the completion script in your /path/to/zsh/completion (typically ~/.zsh/completion/):

  2. Include the directory in your $fpath by adding in ~/.zshrc: Apple capitan download.

  3. Make sure compinit is loaded or do it by adding in ~/.zshrc:

  4. Then reload your shell:

Docker Desktop Brew

Available completions

Cask

Depending on what you typed on the command line so far, it completes:

Docker Desktop Brew

  • available docker-compose commands
  • options that are available for a particular command
  • service names that make sense in a given context, such as services with running or stopped instances or services based on images vs. services based on Dockerfiles. For docker-compose scale, completed service names automatically have “=” appended.
  • arguments for selected options. For example, docker-compose kill -s completes some signals like SIGHUP and SIGUSR1.

Docker Desktop Brewery

Enjoy working with Compose faster and with fewer typos!

Compose documentation

fig, composition, compose, docker, orchestration, cli, reference
Coments are closed
Scroll to top