icon
小维AI总结
HunYuan-Turbos-Latest
思考中···

方法1:配置阿里云镜像源

推荐指数 ⭐

  • 编辑配置文件
1
sudo vim /etc/docker/daemon.json
  • 添加镜像源配置
1
2
3
{
"registry-mirrors": ["https://mezaoeag.mirror.aliyuncs.com"]
}
  • 查询docker信息
1
docker info
  • 重启docker服务
1
2
sudo systemctl daemon-reload
sudo systemctl restart docker
  • 测试拉取镜像
1
2
time docker pull node:latest
time docker pull tomcat:8

方法2:使用第三方镜像源

推荐指数 ⭐

可以问下GPt,huawei有没有这块的镜像,它会去查

或者下面Render 750h每个月实例时间

  • 编辑配置文件
1
vim /etc/docker/daemon.json
  • 添加镜像源配置
1
2
3
4
5
6
7
{
"registry-mirrors": ["https://hub-latest-ffbe.onrender.com"],
"log-opts": {
"max-size": "100m",
"max-file": "5"
}
}
  • 测试拉取镜像
1
docker pull hub-latest-ffbe.onrender.com/library/tomcat:8

方法3:阿里云容器镜像服务+GitHub Actions

推荐指数 ⭐⭐⭐

登录阿里云容器镜像服务

https://cr.console.aliyun.com/

  • 启用个人实例,创建一个命名空间(lucky-warehouse)
  • 查看访问凭证–>获取环境变量
配置项
用户名(ALIYUN_REGISTRY_USER) aliyun3947408954
密码(ALIYUN_REGISTRY_PASSWORD) 你的密码
仓库地址(ALIYUN_REGISTRY) registry.cn-hangzhou.aliyuncs.com
  • 登录阿里云容器镜像服务
1
sudo docker login --username=aliyun3947408954 registry.cn-hangzhou.aliyuncs.com

配置GitHub仓库

GitHub上fork这个项目:https://github.com/tech-shrimp/docker_image_pusher

启用Github Action功能(就是pages那里开启)

进入 Settings -> Secret and variables -> Actions -> New Repository secret

将上一步的四个值配置成环境变量:

1
2
3
4
ALIYUN_NAME_SPACE
ALIYUN_REGISTRY_USER
ALIYUN_REGISTRY_PASSWORD
ALIYUN_REGISTRY

添加镜像

打开images.txt文件,添加镜像可以加tag,也可以不用(默认latest)

1
2
3
4
5
6
7
nginx
quay.io/prometheus/node-exporter:latest
#支持私库
k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0
xhofe/alist:latest
#支持指定架构
--platform=linux/arm64 xiaoyaliu/alist

拉取镜像

回到阿里云,镜像仓库,点击任意镜像,可查看镜像状态。(可以改成公开,拉取镜像免登录)

1
docker pull registry.cn-hangzhou.aliyuncs.com/lucky-warehouse/node-exporter

方法4:科学上网

推荐指数 ⭐⭐⭐⭐⭐

虚拟卡(TUN)模式打开,虚拟机的网络就能访问Docker官网,如果不行,就是服务器版本不支持,太老了