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
相关推荐
雪可问春风20 小时前
docker环境部署
运维·docker·容器
lwx91485220 小时前
Linux-Shell算术运算
linux·运维·服务器
翻斗包菜20 小时前
PostgreSQL 日常维护完全指南:从基础操作到高级运维
运维·数据库·postgresql
somi720 小时前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
双份浓缩馥芮白21 小时前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
海的透彻21 小时前
nginx启动进程对文件的权限掌控
运维·chrome·nginx
路溪非溪21 小时前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
航Hang*21 小时前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
北方的流星1 天前
华三网络设备的路由重定向配置
运维·网络·华三
河南博为智能科技有限公司1 天前
蓄电池在线监测系统-守护数据中心安全防线
运维·边缘计算