MacOS Docker installation
Install using Homebrew
On macOS, we can use Homebrew to install Docker.
Homebrew's Cask already supports Docker for Mac, so it is very convenient to install using Homebrew Cask:
$ brew install --cask --appdir=/Applications docker
==> Creating Caskroom at /usr/local/Caskroom
==> We'll set permissions properly so we won't need sudo in the future
Password: # 输入 macOS 密码
==> Satisfying dependencies
==> Downloading https://download.docker.com/mac/stable/21090/Docker.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask docker
==> Installing Cask docker
==> Moving App 'Docker.app' to '/Applications/Docker.app'.
🍺 docker was successfully installed!
After loading the Docker app, click Next; you may be asked for your macOS login password, so just enter it. Afterwards, a prompt window for Docker running will pop up, and there is also a little whale icon in the status bar (
)。
Manual download and installation
If you need to download manually, click the following link to download Install Docker Desktop on Mac 。

As with other macOS software, installation is very simple: double-click the downloaded .dmg file, then drag the whale icon into the Application folder.

Find the Docker icon in Applications and click to run it. You may be asked for the macOS login password; just enter it.

Clicking the whale icon in the top status bar brings up an action menu.


The first time you click the icon, you may see this installation-success screen; click "Got it!" to close the window.

After launching the terminal, you can check the installed Docker version via a command.
$ docker --version
Docker version 17.09.1-ce, build 19e2cf6
Image acceleration
Given domestic network issues, pulling Docker images later is very slow, so we may need to configure an accelerator to solve this; I use NetEase's mirror address: http://hub-mirror.c.163.com.
In the taskbar, click the Docker for Mac app icon -> Preferences... -> Daemon -> Registry mirrors. Just fill the accelerator address into the list. After making the changes, click the Apply & Restart button, and Docker will restart and apply the configured mirror address.

Afterwards, we can use docker info to check whether the configuration succeeded.
$ docker info
...
Registry Mirrors:
http://hub-mirror.c.163.com
Live Restore Enabled: false