Homebrew 安装 Docker Desktop for Mac

时间:2024-01-25 07:21:33

无意中发现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

$ 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'.