安装docker:

brew install docker

运行:

docker run -d -p 80:80 --name webserver nginx

报错:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

原因:没有安装或打开Docker客户端

解决:

$ brew cask install docker

Then launch the Docker app. Click next. It will ask for privileged access. Confirm. A whale icon should appear in the top bar. Click it and wait for “Docker is running” to appear.

You should be able to run docker commands now.

$ docker ps

可参考:

Logo

云原生社区为您提供最前沿的新闻资讯和知识内容

更多推荐