解决方案
sudo curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
安装完成后HelloWorld跑不起来,需要配置最新可用的镜像源
⚠️⚠️⚠️ 自 2024-06-06 开始,国内的 Docker Hub 镜像加速器相继停止服务,可选择为 Docker daemon 配置代理或自建镜像加速服务
sudo vim /etc/docker/daemon.json
{ "registry-mirrors": [ "https://x9r52uz5.mirror.aliyuncs.com", "https://dockerhub.icu", "https://docker.chenby.cn", "https://docker.1panel.live", "https://docker.awsl9527.cn", "https://docker.anyhub.us.kg", "https://dhub.kubesre.xyz" ] }
sudo systemctl daemon-reload sudo systemctl restart docker
docker info
本文链接:https://blog.runxinyun.com/post/220.html 转载需授权!
留言0