Loading

Homebrew 安装 Docker Desktop for Mac

无意中发现Homebrew现在已经支持Docker Desktop for Mac了,因此特意把原来通过 https://docs.docker.com/docker-for-mac/install/安装的Docker App给卸载了,重新用Homebrew安装了一遍(我是多爱包管理器啊~_~)。

首先当然是search

$ brew search docker
==> Formulae
docker                                   docker-machine-driver-hyperkit
docker-clean                             docker-machine-driver-vmware
docker-cloud                             docker-machine-driver-vultr
docker-completion                        docker-machine-driver-xhyve
docker-compose                           docker-machine-nfs
docker-compose-completion                docker-machine-parallels
docker-credential-helper                 docker-squash
docker-credential-helper-ecr             docker-swarm
docker-gen                               docker2aci
docker-ls                                dockerize
docker-machine                           lazydocker
docker-machine-completion

==> Casks
docker                                   homebrew/cask-versions/docker-edge
docker-toolbox

发现有两个docker包,分别用info看下详情

$ brew info docker
docker: stable 19.03.1 (bottled)
Pack, ship and run any application as a lightweight container
https://www.docker.com/
Not installed
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/docker.rb
==> Dependencies
Build: go ✘
==> Analytics
install: 37,978 (30 days), 102,766 (90 days), 391,771 (365 days)
install_on_request: 31,071 (30 days), 86,525 (90 days), 334,130 (365 days)
build_error: 0 (30 days)
$ brew cask info docker
docker: 2.1.0.1,37199 (auto_updates)
https://www.docker.com/community-edition
Not installed
From: https://mirrors.ustc.edu.cn/homebrew-cask.git
==> Names
Docker Community Edition
Docker CE
==> Artifacts
Docker.app (App)

从详情中可以看出,cask下的才是Docker Desktop for Maccore下的是docker engine

install

$ brew cask install docker
==> Satisfying dependencies
==> Downloading https://download.docker.com/mac/stable/37199/Docker.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'docker'.
==> Installing Cask docker
==> Moving App 'Docker.app' to '/Applications/Docker.app'.
🍺  docker was successfully installed!

安装完成,现在可以同启动台里找到Docker.app了,打开后会在顶部菜单栏里出现 docker logo,并且会弹出登陆界面,登陆后就能正常使用Docker Desktop for Mac了。


图片引用自https://docs.docker.com/docker-for-mac/install/

preferences

登陆成功后,选择Preferences中的Daemon Tab,添加 Registry mirrors(忽略这一步也行,不过docker hub网速实在太慢,还是用国内镜像比较靠谱)。

国内很多云厂商都有自己的镜像仓库,这里我选择用阿里云的(毕竟大家都有支付宝、淘宝账号)。登陆阿里云控制台后,在顶部搜索“容器镜像服务”即可进入容器镜像产品控制台。

选择镜像加速器后,复制右侧的加速地址到Docker Desktop for MacRegistry mirrors里即可。

posted @ 2019-08-23 12:26  larva-zhang  阅读(5694)  评论(1编辑  收藏  举报