docker_practice/install/mac.md

78 lines
2.4 KiB
Go
Raw Normal View History

# macOS Docker
2016-11-12 02:47:24 +08:00
##
2016-11-12 02:47:24 +08:00
[Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/) 要求系统最低为 macOS Catalina 10.13。
2016-11-12 02:47:24 +08:00
##
2016-11-12 02:47:24 +08:00
### 使 Homebrew
2016-11-12 02:47:24 +08:00
[Homebrew](https://brew.sh/) 的 [Cask](https://github.com/Homebrew/homebrew-cask) 已经支持 Docker Desktop for Mac因此可以很方便的使用 Homebrew Cask 来进行安装:
```bash
2017-11-22 20:28:10 +08:00
$ 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。
2016-11-12 02:47:24 +08:00
macOS `.dmg` [Moby](https://www.docker.com/blog/call-me-moby-dock/) 的鲸鱼图标拖拽到 `Application` 文件夹即可(其间需要输入用户密码)。
2016-11-12 02:47:24 +08:00
2017-11-30 15:57:27 +08:00
![](_images/install-mac-dmg.png)
2016-11-12 02:47:24 +08:00
##
2016-11-12 02:47:24 +08:00
Docker
2017-11-30 15:57:27 +08:00
![](_images/install-mac-apps.png)
2016-11-12 02:47:24 +08:00
Docker
2017-11-30 15:57:27 +08:00
![](_images/install-mac-menubar.png)
2016-11-12 02:47:24 +08:00
"Got it!"
2017-11-30 15:57:27 +08:00
![](_images/install-mac-success.png)
2016-11-12 02:47:24 +08:00
2017-11-30 15:57:27 +08:00
![](_images/install-mac-menu.png)
2016-11-12 02:47:24 +08:00
Docker
```bash
$ docker --version
Docker version 19.03.8, build afacb8b
2016-11-12 02:47:24 +08:00
$ docker-compose --version
docker-compose version 1.25.5, build 8a1c60f6
2016-11-12 02:47:24 +08:00
$ docker-machine --version
docker-machine version 0.16.1, build cce350d7
2016-11-12 02:47:24 +08:00
```
2018-12-14 19:08:14 +08:00
`docker version``docker info` [Nginx ](https://hub.docker.com/_/nginx/)
2016-11-12 02:47:24 +08:00
```bash
$ docker run -d -p 80:80 --name webserver nginx
```
访 <http://localhost>,如果看到了 "Welcome to nginx!",就说明 Docker Desktop for Mac 安装成功了。
2016-11-12 02:47:24 +08:00
2017-11-30 15:57:27 +08:00
![](_images/install-mac-example-nginx.png)
2016-11-12 02:47:24 +08:00
Nginx
```bash
$ docker stop webserver
$ docker rm webserver
```
2017-09-04 11:17:56 +08:00
##
2017-09-04 11:17:56 +08:00
2019-01-06 10:00:38 +08:00
使 Docker Docker [](mirror.md)
##
* [](https://docs.docker.com/docker-for-mac/install/)