Docker for Mac状态“Running”是什么意思?

当我双击菜单栏中的Docker for Mac图标时,我看到一个图标出现:

在这里输入图像说明

我有两个问题:

1)如何通过命令行获得相同的效果? – >截至今天,命令行只是给了我docker的命令

Mac:bin romain$ docker Usage: docker [OPTIONS] COMMAND [arg...] docker [ --help | -v | --version ] A self-sufficient runtime for containers. Options: --config=~/.docker Location of client config files -D, --debug Enable debug mode -H, --host=[] Daemon socket(s) to connect to -h, --help Print usage -l, --log-level=info Set the logging level --tls Use TLS; implied by --tlsverify --tlscacert=~/.docker/ca.pem Trust certs signed only by this CA --tlscert=~/.docker/cert.pem Path to TLS certificate file --tlskey=~/.docker/key.pem Path to TLS key file --tlsverify Use TLS and verify the remote -v, --version Print version information and quit Commands: attach Attach to a running container build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container diff Inspect changes on a container's filesystem events Get real time events from the server exec Run a command in a running container 

2)“docker正在运行”意味着什么 – 我知道容器可以运行,但是Docker?

您可以在命令行上使用open -a Docker

对于Docker来说,“运行”意味着Docker守护进程能够接受像docker ps这样的命令,并且做你期望的事情,比如把你的命令传递给适当的容器,或者从容器或守护进程中返回一些东西。

当Docker for Mac说它正在运行时,这意味着虚拟Docker环境正在您的机器上运行。 Mac版Docker使用xhyve在Mac上运行小型Linux VM。

Docker本身作为该VM内部的守护进程运行。 Docker for Mac菜单栏图标的状态显示该Linux VM是否已启动。

您可以在terminal中运行的docker命令允许您与在该Linux VM中运行的Docker守护程序进行交互。 您可以使用docker命令来创build映像或创build/启动/停止容器。