Operation of replacing domestic image source for Docker

  • 2021-09-16 08:29:29
  • OfStack

Configure the accelerator for the Docker daemon

Start Docker from the configuration file, modify the/etc/docker/daemon. json file and add registry-mirrors key values.


vim /etc/docker/daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}

After the modification is saved, restart Docker for the configuration to take effect.

service docker restart

Additional knowledge: docker configuration mirror accelerator

Modify the default mirror source to domestic mirror source to improve the download speed

Profile:


cat > /etc/docker/daemon.json << EOF
{
 "registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"]
}
EOF

Restart service:

systemctl restart docker

docker info can see what the current mirror accelerator is

Other Mirror Accelerators

Netease: http://hub-mirror.c.163. com

Ali: https://cr.console.aliyun.com

docker China site: https://registry.docker-cn.com


Related articles: