Two methods for Windows Docker to configure domestic mirror sources
Update time 2022.04.14 Configure domestic image source
through Docker-Desktop interface operation and modify daemon.json
Method 1: Configure through Docker-Desktop
- click settings
- Choose Docker Engine
- Add the following source address
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://mirror.ccs.tencentyun.com"
]
- Apply and restart Docker
Method 2: Configure through daemon.json
Taking my local machine as an Administrator account as an example, the configuration file is located in C:\Users\Administrator\.docker\
the directorydaemon.json
Modify the configuration file and add the domestic source address
Open the daemon.json file and add the following source addresses
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
},
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://mirror.ccs.tencentyun.com"
]
}
If registry-mirrors
the replacement already exists
- Click Troubleshoot
- Click Restart