docker_practice/install/mac.md

78 lines
2.4 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 Desktop CE
##
[Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/) 要求系统最低为 macOS Catalina 10.13。
##
### 使 Homebrew
[Homebrew](https://brew.sh/) 的 [Cask](https://github.com/Homebrew/homebrew-cask) 已经支持 Docker Desktop for Mac因此可以很方便的使用 Homebrew Cask 来进行安装:
```bash
$ brew cask install docker
```
###
[Stable](https://download.docker.com/mac/stable/Docker.dmg) 或 [Edge](https://download.docker.com/mac/edge/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)
"Got it!"
![](_images/install-mac-success.png)
![](_images/install-mac-menu.png)
Docker
```bash
$ docker --version
Docker version 19.03.8, build afacb8b
$ docker-compose --version
docker-compose version 1.25.5, build 8a1c60f6
$ docker-machine --version
docker-machine version 0.16.1, build cce350d7
```
`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/)