type
status
date
slug
summary
tags
category
icon
password
网址
😀
这个方案免费有效,但需要注意前提条件哦~
 

📝 主旨内容

前提条件:

1、注册cloudflare 账号[以下有步骤]
2、一个域名,需要将dns服务器指向 cloudflare 进行托管

一、首先安装 wrangler 命令行工具

  1. 安装 npm 服务
notion image
1.声明npm代理
  1. 安装 wrangler 工具
3.登录授权 wrangler
notion image

二、配置 cloudflare 的 worker 项目

  1. 安装 git 工具
  • 在 git 官网 下载安装包,一键安装
2.下载 hammal 项目
notion image
3.配置文件中,需要修改几个内容
  • account_id 通过下面命令获取
notion image
  • name 自定义,如设置:docker-proxy
  • 添加内容
  • kv_namespace 中,binding保持不变,id通过下面命令创建获取
notion image
3.部署应用
notion image

三、绑定自定义域名发布

1.在任意厂商申请一个域名,在cloudflare进行绑定
notion image
2.按照提示,修改dns服务器,指向 cloudflare
3.在 worker 项目中,添加绑定的域名
notion image

四、修改 docker 配置文件,添加代理域名

1.修改 /etc/docker/daemon.json 文件,内容如下
2.进行测试
3.该项目也可以加速 k8s.gcr.io, gcr.io, quay.io 的镜像
notion image
  • 免费计划支持每天 10w 次的请求调用,足以满足日常用户使用
notion image

📎 参考文章

 
💡
亲测有效,是个人长期文档可维护的方案,动手试试吧~