docker-image/README.md
2024-06-11 22:06:11 +08:00

38 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Docker-Image
运行于 cloudflare workers 上的 Docker 镜像加速工具,用于解决获取 Docker 官方镜像无法正常访问的问题。
修改自:[https://github.com/tomwei7/hammal](https://github.com/tomwei7/hammal)
## 使用说明
### Fork & Clone
首先 fork 仓库 [Docker-Image](https://github.com/woodchen/docker-image) ,并克隆到本地
> 可以的话顺便给个 Star😂
使用 `pnpm install` 安装依赖
### 创建 Workers 项目
进入 [Cloudflare Dashboard](https://dash.cloudflare.com/ "https://dash.cloudflare.com/") 创建一个新的 Workers 项目,给他一个命名(例如 `docker-image`
复制 `wrangler.toml.sample` 文件改名 `wrangler.toml` 并修改其 `name``account_id`
account\_id 可以通过 `npx wrangler whoami` 获得,也可以从 CF Workers Dashboard 右侧获得
### 创建 cache 缓存 kv
在克隆好的项目目录下执行 `npx wrangler kv:namespace create hammal_cache` 来创建缓存 kv记录下来输出的 id填写到 `wrangler.toml` 文件中
### Deploy
在克隆好的项目目录下执行 `pnpm run deploy` 来部署项目
进入你的 Workers 脚本的 dashboard为它绑定一个自定义域名必要因为默认的 `workers.dev` 域名被墙了)
### 访问
直接访问自己绑定的域名就知道怎么用了