在 macos catalina 上安装 docker

Install docker on macos catalina

如何在 macos catalina 中安装 docker。我尝试了一些命令,但它给了我错误

第一种方式

brew install docker
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 805f0ba3c to e344cb6af.
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
func-e                                                                         mariadb@10.5                                                                   scorecard
==> Updated Formulae
Updated 987 formulae.
==> New Casks
itraffic                                                                                                               millie
==> Updated Casks
Updated 82 casks.


==> Homebrew was updated to version 3.2.2
The changelog can be found at:
  https://github.com/Homebrew/brew/releases/tag/3.2.2
Warning: Treating docker as a formula. For the cask, use homebrew/cask/docker
==> Downloading https://ghcr.io/v2/homebrew/core/docker/manifests/20.10.7
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/docker/blobs/sha256:4d09b76ce85c651cb4454ddf2ed8b3f680231793747f5d997a1a41111e92e997
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:4d09b76ce85c651cb4454ddf2ed8b3f680231793747f5d997a1a41111e92e997?se=2021-07-13T10%3A55%3A00Z&sig=LsXE2Zl837KnqgAAJ%2BrUbN%2BpuRa7tvImtKh36kwMRPc%3D&sp=
######################################################################## 100.0%
==> Pouring docker--20.10.7.catalina.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
  /usr/local/Cellar/docker/20.10.7: 12 files, 58.9MB



docker pull ruby
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
aniket_tiwari@ACD-123-1212 ~ % sudo docker pull ruby
Password:
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

然后我卸载它并使用cask安装

第二种方式

brew install --cask docker

Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from e344cb6af to cc03c2c15.
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
fluid-synth@2.1                                                                libfuse@2                                                                      rhit
==> Updated Formulae
Updated 213 formulae.
==> Updated Casks
Updated 31 casks.

==> Downloading https://desktop.docker.com/mac/stable/amd64/66501/Docker.dmg
######################################################################## 100.0%
==> Installing Cask docker
==> Moving App 'Docker.app' to '/Applications/Docker.app'
==> Linking Binary 'docker-compose.bash-completion' to '/usr/local/etc/bash_completion.d/docker-compose'
==> Linking Binary 'docker.zsh-completion' to '/usr/local/share/zsh/site-functions/_docker'
==> Linking Binary 'docker.fish-completion' to '/usr/local/share/fish/vendor_completions.d/docker.fish'
==> Linking Binary 'docker-compose.fish-completion' to '/usr/local/share/fish/vendor_completions.d/docker-compose.fish'
==> Linking Binary 'docker-compose.zsh-completion' to '/usr/local/share/zsh/site-functions/_docker_compose'
==> Linking Binary 'docker.bash-completion' to '/usr/local/etc/bash_completion.d/docker'
  docker was successfully installed!
aniket_tiwari@ACD-123-1212 ~ % docker ps
zsh: command not found: docker
aniket_tiwari@ACD-123-1212 ~ % docker version
zsh: command not found: docker
aniket_tiwari@ACD-123-1212 ~ % docker --version
zsh: command not found: docker

MacOS 卡特琳娜 - 10.15.7

我可以通过官方 docker 网站安装 https://docs.docker.com/docker-for-mac/install/

下载了最新的docker基于芯片。就我而言,它是 Mac 英特尔芯片。

最后双击Docker.dmg打开安装程序,然后将Docker图标拖到Applications文件夹