You can use Homebrew to install Docker. Homebrew's Cask already supports Docker for Mac.
If you don't have Homebrew, you can refer to the article Mac's Homebrew_IMSince1999's blog-CSDN blog
start installation:
1. Terminal input:
brew install --cask --appdir=/Applications docker
2. Appears: docker was successfully installed! The installation was successful.
3. The first time you use it, you need to confirm the local password.
4. After entering the password, the following interface pops up.
5. After the installation is successful, you can check the docker version on the terminal. After the version is displayed, the installation is successful.
docker --version
2. Docker domestic image configuration
After adding the following code in the red box, click the Apply & Restart button:
{
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "20GB"
}
},
"experimental": false,
"features": {
"buildkit": true
},
"registry-mirrors":[
"http://hub-mirror.c.163.com"
]
}
Check whether the image is applied successfully. The content in the red box is the domestic image configured above:
docker info
Attached are common domestic docker images:
1. University of Science and Technology of China: https://docker.mirrors.ustc.edu.cn
2. NetEase: http://hub-mirror.c.163.com
3. Docker official China area: https://registry.docker-cn.com
4. Qiniu Cloud: https://reg-mirror.qiniu.com