docker_practice/install/mac.md

70 lines
2.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# macOS Docker
##
[Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/) 要求系统最低为 macOS Mojave 10.14。
##
### 使 Homebrew
[Homebrew](https://brew.sh/) 的 [Cask](https://github.com/Homebrew/homebrew-cask) 已经支持 Docker Desktop for Mac因此可以很方便的使用 Homebrew Cask 来进行安装:
```bash
$ brew cask install docker
```
###
[](https://desktop.docker.com/mac/stable/Docker.dmg) 下载 Docker Desktop for Mac。
macOS `.dmg` [Moby](https://www.docker.com/blog/call-me-moby-dock/) 的鲸鱼图标拖拽到 `Application` 文件夹即可(其间需要输入用户密码)。
![](./_images/install-mac-dmg.png)
##
Docker
![](./_images/install-mac-apps.png)
Docker
![](./_images/install-mac-menubar.png)
![](./_images/install-mac-menu.png)
Docker
```bash
$ docker --version
Docker version 20.10.0, build 7287ab3
```
`docker version``docker info` [Nginx ](https://hub.docker.com/_/nginx/)
```bash
$ docker run -d -p 80:80 --name webserver nginx
```
访 <http://localhost>,如果看到了 "Welcome to nginx!",就说明 Docker Desktop for Mac 安装成功了。
![](./_images/install-mac-example-nginx.png)
Nginx
```bash
$ docker stop webserver
$ docker rm webserver
```
##
使 Docker Docker [](mirror.md)
##
* [](https://docs.docker.com/docker-for-mac/install/)