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
相关推荐
羑悻的小杀马特2 小时前
把随身WiFi改成网盘聚合器:中兴F50挂载本地存储+夸克网盘实战
运维·服务器·人工智能·网盘·openlist
Yana.nice10 小时前
Linux 只保留 30 天内日志(find命令删除日志文件)
linux·运维·chrome
2601_9605679612 小时前
电商套图自动化效率的工程量化分析——从逐张生成到批量套图的架构演进
运维·架构·自动化
吳所畏惧13 小时前
宝塔面板Redis密码修改指南:SSH命令修改 vs 面板UI界面修改,哪个更靠谱?
运维·服务器·数据库·redis·缓存·ssh
张忠琳13 小时前
【NVIDIA】 NVIDIA Container Toolkit v1.19.1 — OCI 模块超深度分析之三
云原生·容器·架构·kubernetes·nvidia
HiDev_14 小时前
【非标自动化】2、认识元器件(确定目标)
运维·自动化
Zhang~Ling14 小时前
从 fopen 到 struct file:从零开始拆解 Linux 文件 I/O
linux·运维·服务器
爱写代码的森14 小时前
蒙三方库 | harmony-utils之FileUtil文件重命名与属性查询详解
linux·运维·服务器·华为·harmonyos·鸿蒙·huawei
Elastic 中国社区官方博客15 小时前
将你的 Grafana Kubernetes 仪表板迁移到 Elastic Observability:相同的 PromQL,30 倍更快的查询
大数据·人工智能·elasticsearch·搜索引擎·容器·kubernetes·grafana
中微极客15 小时前
2026主流AI Agent框架技术选型与性能对比
运维·网络·人工智能