Two methods for Windows Docker to configure domestic mirror sources

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
    insert image description here
  • Choose Docker Engine
    insert image description here
  • 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
    insert image description here

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
insert image description here

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-mirrorsthe replacement already exists

  • Click Troubleshoot
    insert image description here
  • Click Restart
    insert image description here

Guess you like

Origin blog.csdn.net/Lyon_Nee/article/details/124169099