{"id":17179881,"url":"https://github.com/tomwei7/hammal","last_synced_at":"2025-04-04T22:09:11.299Z","repository":{"id":85548631,"uuid":"357250669","full_name":"tomwei7/hammal","owner":"tomwei7","description":"docker-registry proxy run in cloudflare workers","archived":false,"fork":false,"pushed_at":"2021-04-13T14:57:47.000Z","size":96,"stargazers_count":74,"open_issues_count":0,"forks_count":774,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T21:09:04.781Z","etag":null,"topics":["docker-registry","workers","wrangler"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomwei7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-12T15:45:08.000Z","updated_at":"2025-03-11T08:03:11.000Z","dependencies_parsed_at":"2023-03-04T07:30:16.807Z","dependency_job_id":null,"html_url":"https://github.com/tomwei7/hammal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwei7%2Fhammal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwei7%2Fhammal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwei7%2Fhammal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwei7%2Fhammal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomwei7","download_url":"https://codeload.github.com/tomwei7/hammal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256115,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-registry","workers","wrangler"],"created_at":"2024-10-15T00:27:57.612Z","updated_at":"2025-04-04T22:09:11.275Z","avatar_url":"https://github.com/tomwei7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hammal\n\nHammal 是运行于 cloudflare workers 上的 Docker 镜像加速工具，用于解决获取 Docker 官方镜像速度缓慢以及完全无法获取 k8s.gcr.io 上镜像的问题。\n\n### 食用方式\n\n首先安装 wrangler 命令行工具 https://developers.cloudflare.com/workers/cli-wrangler/install-update\n\n```\ngit clone https://github.com/tomwei7/hammal.git\ncd hammal\nmv wrangler.toml.sample wrangler.toml\n\n# 获取 account_id id\nwrangler whoami\n\n# 创建 KV namespace\nwrangler kv:namespace create hammal_cache\n\n```\n\n修改 wrangler.toml 文件填充 account_id 与 kv_namespaces 中的 id\n\n```toml\nname = \"hammal\"\ntype = \"webpack\"\naccount_id = \"your account_id\"\nworkers_dev = true\nroute = \"\"\nzone_id = \"\"\nwebpack_config = \"webpack.config.js\"\nkv_namespaces = [\n\t { binding = \"HAMMAL_CACHE\", id = \"you kv id\" }\n]\n```\n\n发布 workers\n\n```\nwrangler publish\n```\n\n发布 workers 可以获得类似 https://hammal.{your_name}.workers.dev  的地址，修改 registry-mirrors 地址为该地址即可\n\n```\n\u003c\u003cEOF sudo tee /etc/docker/daemon.json\n{\n  \"registry-mirrors\": [\n    \"https://hammal.{your_name}.workers.dev\"\n  ]\n}\nEOF\n```\n\n### 获取其他镜像源镜像\n\n目前 hammal 支持获取 `k8s.gcr.io`, `gcr.io`, `quay.io` 的镜像，可以通过修改 handler.ts 中的 `ORG_NAME_BACKEND` 添加\n\n```bash\n# 拉取 k8s.gcr.io 镜像\ndocker pull hammal.{your_name}.workers.dev/k8sgcr/kubernetes-dashboard-amd64:v1.8.3\n\n# 拉取 gcr.io 镜像\ndocker pull hammal.{your_name}.workers.dev/gcr/youlib/image:tags\n\n# 拉取 quay.io 镜像\ndocker pull hammal.{your_name}.workers.dev/quay/coreos/flannel:v0.13.1-rc2\n```\n\n### TODO\n\n- [ ] 私有仓库支持\n- [ ] manifests/blob cache\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomwei7%2Fhammal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomwei7%2Fhammal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomwei7%2Fhammal/lists"}