GithubHelp home page GithubHelp logo

hammal's Introduction

hammal

Hammal 是运行于 cloudflare workers 上的 Docker 镜像加速工具,用于解决获取 Docker 官方镜像速度缓慢以及完全无法获取 k8s.gcr.io 上镜像的问题。

食用方式

首先安装 wrangler 命令行工具 https://developers.cloudflare.com/workers/cli-wrangler/install-update

git clone https://github.com/tomwei7/hammal.git
cd hammal
mv wrangler.toml.sample wrangler.toml

# 获取 account_id id
wrangler whoami

# 创建 KV namespace
wrangler kv:namespace create hammal_cache

修改 wrangler.toml 文件填充 account_id 与 kv_namespaces 中的 id

name = "hammal"
type = "webpack"
account_id = "your account_id"
workers_dev = true
route = ""
zone_id = ""
webpack_config = "webpack.config.js"
kv_namespaces = [
	 { binding = "HAMMAL_CACHE", id = "you kv id" }
]

发布 workers

wrangler publish

发布 workers 可以获得类似 https://hammal.{your_name}.workers.dev 的地址,修改 registry-mirrors 地址为该地址即可

<<EOF sudo tee /etc/docker/daemon.json
{
  "registry-mirrors": [
    "https://hammal.{your_name}.workers.dev"
  ]
}
EOF

获取其他镜像源镜像

目前 hammal 支持获取 k8s.gcr.io, gcr.io, quay.io 的镜像,可以通过修改 handler.ts 中的 ORG_NAME_BACKEND 添加

# 拉取 k8s.gcr.io 镜像
docker pull hammal.{your_name}.workers.dev/k8sgcr/kubernetes-dashboard-amd64:v1.8.3

# 拉取 gcr.io 镜像
docker pull hammal.{your_name}.workers.dev/gcr/youlib/image:tags

# 拉取 quay.io 镜像
docker pull hammal.{your_name}.workers.dev/quay/coreos/flannel:v0.13.1-rc2

TODO

  • 私有仓库支持
  • manifests/blob cache

hammal's People

Contributors

tomwei7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hammal's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.