- 打开终端,输入以下命令下载清华镜像站提供的docker源
sudo curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/mac/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/mac $(lsb_release -cs) stable"
- 更新apt-get源,以使用清华镜像站提供的docker源
sudo apt-get update
- 验证docker源已经更改到清华镜像站的源
sudo apt-cache policy docker-ce
如果docker-ce的版本是从清华源下载的,则将版本号和清华镜像站的URL列出。
- 重启docker服务
sudo systemctl restart docker
现在您已经成功将Docker的镜像源更改为清华镜像站的源。