MacOS Docker installation
Install with Homebrew
brew install --cask --appdir=/Applications docker
After the installation is successful, run Docker.app
Until the following icon appears
Use docker --version to view the version
hu4wufu@bogon ~ % docker --version
Docker version 20.10.2, build 2291f61
If docker version
, docker info
are normal, you can try to run a Nginx server :
$ docker run -d -p 80:80 --name webserver nginx
After the service is running, you can visit http://localhost . If you see "Welcome to nginx!", it means that Docker Desktop for Mac is installed successfully.
To stop the Nginx server and delete execute the following command:
$ docker stop webserver
$ docker rm webserver
Official documents:
https://docs.docker.com/docker-for-mac/install/
Reference link:
https://www.runoob.com/docker/macos-docker-install.html
https://yeasy.gitbook.io/docker_practice/install/mac