ubuntu20.04上docker部署

1.docker安装方法:

docker安装方法

2.拉取失败

sudo docker pull hello-world

2.1解决方法

方案1:配置国内镜像加速器(成功率最高,强烈推荐)

bash 复制代码
sudo tee /etc/docker/daemon.json <<-'eof'
{
"registry-mirrors": [
    "https://docker.m.daocloud.io",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://docker.nju.edu.cn",
    "https://docker.m.daocloud.io",
    "https://dockerproxy.com",
    "https://docker.m.daocloud.io"
  ]
}
eof

重启docker

bash 复制代码
sudo systemctl daemon-reload
sudo systemctl restart docker

再次拉取

bash 复制代码
sudo docker pull hello-world

方案2:2025~2026年仍然比较稳定的几个代理镜像站(直接拉取)

bash 复制代码
# 方式1:最常用(推荐)
sudo docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/hello-world:latest

# 方式2:华为云
sudo docker pull swr.cn-south-1.myhuaweicloud.com/ddn-k8s/hello-world:latest

# 方式3:中科大(更新比较勤快)
sudo docker pull docker.mirrors.ustc.edu.cn/library/hello-world:latest

成功拉下来之后可以重新 tag 成官方名字:

bash 复制代码
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/hello-world:latest hello-world:latest
相关推荐
dyj09533 分钟前
Dify - (一)、本地部署Dify+聊天助手/Agent
人工智能·docker·容器
wanhengidc44 分钟前
云手机 高振畅玩不踩坑
运维·服务器·安全·web安全·智能手机
有谁看见我的剑了?1 小时前
linux 添加硬盘后系统识别不到硬盘处理
linux·运维·服务器
JoyCong19981 小时前
ToDesk远程屏幕墙技术白皮书:如何重塑全局运维视界
运维·电脑·远程工作
偶尔上线经常挺尸2 小时前
《100个“反常识”经验15:Nginx 502排查:从应用到内核》
运维·nginx·性能调优·反向代理·502错误·http排错
思茂信息2 小时前
CST软件如何进行参数化扫描?
运维·开发语言·javascript·windows·ecmascript·软件工程·软件需求
计算机安禾3 小时前
【Linux从入门到精通】第31篇:防火墙漫谈——iptables与firewalld防护指南
linux·运维·php
下一页盛夏花开3 小时前
ubuntu 20中安装QT以后出现红色空心断点
linux·运维·ubuntu
Nice_Fold4 小时前
Kubernetes DaemonSet、StatefulSet与Service(自用笔记)
笔记·容器·kubernetes