1、使用 Homebrew 来安装 Docker
$ brew cask install 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!
2、载入 Docker app 后,点击 Next,如果需要macOS 登陆密码,输入就好了。 3、安装成功后,会弹出一个 Docker 运行的提示窗口,顶部状态栏上会出现一个小鲸鱼的图标
4、点击顶部状态栏中的鲸鱼图标打开操作菜单,会出现安装成功的界面,点击got it 关闭
之后打开鲸鱼图标会显示操作菜单
查看安装后的 Docker 版本。
$ docker --version
Docker version 19.03.1, build 74b1e89
5、配置加速器,提高拉取镜像的速度,状态栏点击鲸鱼图标打开菜单栏,网易镜像地址:http://hub-mirror.c.163.com
// 查看是否配置成功,出现下面的内容说明安装成功
// Registry Mirrors:
// http://hub-mirror.c.163.com
$ docker info
Registry Mirrors:
http://hub-mirror.c.163.com/
Live Restore Enabled: false
Product License: Community Engine