Homebrew 安裝 Docker Desktop for Mac

無心中發現Homebrew如今已經支持Docker Desktop for Mac了,所以特地把原來經過 https://docs.docker.com/docker-for-mac/install/安裝的Docker App給卸載了,從新用Homebrew安裝了一遍(我是多愛包管理器啊~_~)。git

首先固然是searchdocker

$ 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看下詳情bash

$ 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 engineapp

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了。


ui

圖片引用自https://docs.docker.com/docker-for-mac/install/阿里雲

preferences

登錄成功後,選擇Preferences中的Daemon Tab,添加 Registry mirrors(忽略這一步也行,不過docker hub網速實在太慢,仍是用國內鏡像比較靠譜)。

國內不少雲廠商都有本身的鏡像倉庫,這裏我選擇用阿里雲的(畢竟你們都有支付寶、淘寶帳號)。登錄阿里雲控制檯後,在頂部搜索「容器鏡像服務」便可進入容器鏡像產品控制檯。

選擇鏡像加速器後,複製右側的加速地址到Docker Desktop for MacRegistry mirrors裏便可。
3d

相關文章
相關標籤/搜索