在/etc/docker/daemon.json文件中寫入
{
"registry-mirrors": [
"Welcome to nginx!"
]
}
執行
systemctl daemon-reload
systemctl restart docker
docker info能夠看到源已經被替換
現在國內能夠使用的docker源經過測試只有Welcome to nginx!
由于使用docker pull和docker search命令默認還是會使用默認的index.docker.io源,因此在執行pull的時候必須指定源,例如
docker pull ccr.ccs.tencentyun.com/library/centos:latest