安装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

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐