docker运行macos,mac下docker

1、安装

docker官网找到for mac的安装包Docker.dmg文件下载安装即可。将docer拖到应用里。安装成功后任务栏会有docker标志。

配置镜像地址

打开任务栏图标,进入preferences,如下图配置镜像。比如可以配置这些镜像。

https://docker.mirrors.ustc.edu.cn

http://ead3d542.m.daocloud.io

http://hub-mirror.c.163.com

2、验证安装

查看版本

打开终端,输入命令docker version,如下

xxdfh$ docker versionClient: Docker Engine – Community Version: 18.09.2 API version: 1.39 Go version: go1.10.8 Git commit: 6247962 Built: Sun Feb 10 04:12:39 2019 OS/Arch: darwin/amd64 Experimental: falseServer: Docker Engine – Community Engine: Version: 18.09.2 API version: 1.39 minimum version 1.12) Go version: go1.10.6 Git commit: 6247962 Built: Sun Feb 10 04:13:06 2019 OS/Arch: linu快三稳赚计划导师: falseServer: Docker Engine – Community Engine: Version: 18.09.2 API version: 1.39 minimum version 1.12) Go version: go1.10.6 Git commit: 6247962 Built: Sun Feb 10 04:13:06 2019 OS/Arch: linux/amd64 Experimental: true

启动ngnix容器

会自动下载镜像,运行如下

xxdfh$ docker run -d -p80:80 –name webserver nginxUnable to find image ‘nginx:latest’ locallylatest: Pulling from library/nginx6ae821421a7d: Pull complete 58702d4af197: Pull complete b165f42e8fd4: Pull complete Digest: sha256:272dbcc93e9a1d312632f28927512152e53a6a0607e588489d1397c562c73f40Status: Downloaded newer image for nginx:latestd994280e330a824992449578ee77f4f22fd84746ffa6b57b7316443e088f4f07YOUSHANYANG-MB0:~ xxdfh$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESd994280e330a nginx “nginx -g ‘daemon of…” 20 seconds ago Up 19 seconds 0.0.0.0:80->80/tcp webserver

输入:http://0.0.0.0:80,打开如下页面

 

 

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注