要设置加速镜像服务,你可以执行下面命令:
sudo tee /etc/docker/daemon.json <<EOF
{
"registry-mirrors": ["https://docker.zhuoyuan-he.cn"]
}
EOF
sudo systemctl restart docker # 重启生效
如果执行了上述命令,配置了镜像加速服务,可以直接 pull 镜像:
docker pull alpine:latest # 拉取 alpine 镜像
不修改镜像地址,手动 pull 镜像:
docker pull docker.zhuoyuan-he.cn/alpine:latest # 拉取 alpine 镜像