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
相关推荐
辞旧 lekkk2 分钟前
【Linux】Linux进程控制(三)自主实现简易shell命令行解释器
linux·运维·服务器·学习·萌新
HIT_Weston13 分钟前
119、【Ubuntu】【Hugo】首页板块配置:Template Lookup Order
linux·运维·ubuntu
wangt595217 分钟前
Ubuntu22.04.5的网络配置在重启后被重置的问题
linux·运维·服务器
不被定义的程序猿17 分钟前
如何使用docker搭建一个 aarch-linux-gun-gcc的交叉编译环境
linux·运维·服务器
RisunJan19 分钟前
Linux命令-logrotate(自动轮转、压缩、删除和邮件发送日志文件)
linux·运维·服务器
chao_78925 分钟前
双设备全栈开发最佳实践[mac系统]
git·python·macos·docker·vue·全栈
ALGO阿狗36 分钟前
一款简单易用的远程日志查看器,可实时查看云服务器上的日志数据
运维·服务器·日志
微露清风38 分钟前
系统性学习Linux-第三讲-进程概念
linux·运维·学习
请你喝好果汁64138 分钟前
Linux-sh -c \dirname
linux·运维·服务器
Trouvaille ~39 分钟前
【Linux】线程同步与互斥(四):线程池与任务管理
linux·运维·服务器·c++·操作系统·线程池·日志系统